display text dependent on field value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.
 
Karla V said:
I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.

You can set this field up in the underlying query if you like.
Go into design view of the query and create a new field...
In the Field Name row type:
VALUE: IIf([Value]="A",[Paragraph A],[Paragraph B])
Run the query to ensure it is working properly and save the query.
Add this new field to your report in design view.
I hope this helps!
 
I'm not sure what you mean by [Paragraph A], [Paragraph B] - do I need to
save these as separate fields within that query or in a separate table? My
paragraphs are pretty lengthy (8-10 sentences long), so I'm sure they will
not fit in a regular field, it would have to be a memo.

Thanks for your help so far!

Brenda@DMS said:
Karla V said:
I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.

You can set this field up in the underlying query if you like.
Go into design view of the query and create a new field...
In the Field Name row type:
VALUE: IIf([Value]="A",[Paragraph A],[Paragraph B])
Run the query to ensure it is working properly and save the query.
Add this new field to your report in design view.
I hope this helps!
 
Karla,

Looks like your "paragraphs" are not coming from the data
source.
Two approaches:
If they are the same length or won't affect other stuff on
your report if they are different lengths. Create two text
boxes with the alternate paragraphs and set "Visible"
property to no. Place the two text boxes on top of each
other in the desired location. In the section's format
event set the "visible" property of the appropriate text
box on.

Otherwise create one text box with =iif ([myvalue]
= "A","Paragraph A text","Paragraph B text") I am unsure
how this will treat text strings longer than 255
characters.

Let us know how you go.

HTH

Terry
-----Original Message-----
I'm not sure what you mean by [Paragraph A], [Paragraph B] - do I need to
save these as separate fields within that query or in a separate table? My
paragraphs are pretty lengthy (8-10 sentences long), so I'm sure they will
not fit in a regular field, it would have to be a memo.

Thanks for your help so far!

Brenda@DMS said:
Karla V said:
I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.

You can set this field up in the underlying query if you like.
Go into design view of the query and create a new field...
In the Field Name row type:
VALUE: IIf([Value]="A",[Paragraph A],[Paragraph B])
Run the query to ensure it is working properly and save the query.
Add this new field to your report in design view.
I hope this helps!
.
 
Terry,

Yes, you are correct that my "paragraphs" are not coming from the data
source. Here's some background that might make my question more clear.

The report is actually a memo for a week-long internal seminar. Some of the
15 attendees must attend all five days. But, anyone who has attended a
similar seminar in the last six months can skip day 1. So, in my query, I
have a field that returns yes or no based on a date calculation of when they
last attended. This is all working just fine.

On to the report: I could create 2 separate reports - one for "yes"
training and one for "no" training. This is, in fact, how we've been doing
it for quite some time. But, I'm hoping there is a way to run the report
once for all employees and have it pull the right "paragraph". The
"paragraphs" are 2 separate text boxes that contains some basic information
like "You have not attended the day 1 training and must attend this time. It
will be held in Room 201 beginning at 7:00 am. etc." or "You have attended
during the last six months. Please arrive Tuesday morning at 7:00 a.m."

So, I think your first suggestion is the right way to go. I have both text
boxes created, visible set to "no" and they are on top of each other. Can
you shed some more light on what to do now?

Thank you!


Terry said:
Karla,

Looks like your "paragraphs" are not coming from the data
source.
Two approaches:
If they are the same length or won't affect other stuff on
your report if they are different lengths. Create two text
boxes with the alternate paragraphs and set "Visible"
property to no. Place the two text boxes on top of each
other in the desired location. In the section's format
event set the "visible" property of the appropriate text
box on.

Otherwise create one text box with =iif ([myvalue]
= "A","Paragraph A text","Paragraph B text") I am unsure
how this will treat text strings longer than 255
characters.

Let us know how you go.

HTH

Terry
-----Original Message-----
I'm not sure what you mean by [Paragraph A], [Paragraph B] - do I need to
save these as separate fields within that query or in a separate table? My
paragraphs are pretty lengthy (8-10 sentences long), so I'm sure they will
not fit in a regular field, it would have to be a memo.

Thanks for your help so far!

Brenda@DMS said:
:

I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.

You can set this field up in the underlying query if you like.
Go into design view of the query and create a new field...
In the Field Name row type:
VALUE: IIf([Value]="A",[Paragraph A],[Paragraph B])
Run the query to ensure it is working properly and save the query.
Add this new field to your report in design view.
I hope this helps!
.
 
Solution found! After my two text boxes were set to Visible=No, I created a
third text box in the correct location (actually on top of my other two text
boxes) that contained an IF statement.

IIF([Training]="yes",[paragraphA],[paragraphB])

It works great - Thanks for putting me on the right track!


Karla V said:
Terry,

Yes, you are correct that my "paragraphs" are not coming from the data
source. Here's some background that might make my question more clear.

The report is actually a memo for a week-long internal seminar. Some of the
15 attendees must attend all five days. But, anyone who has attended a
similar seminar in the last six months can skip day 1. So, in my query, I
have a field that returns yes or no based on a date calculation of when they
last attended. This is all working just fine.

On to the report: I could create 2 separate reports - one for "yes"
training and one for "no" training. This is, in fact, how we've been doing
it for quite some time. But, I'm hoping there is a way to run the report
once for all employees and have it pull the right "paragraph". The
"paragraphs" are 2 separate text boxes that contains some basic information
like "You have not attended the day 1 training and must attend this time. It
will be held in Room 201 beginning at 7:00 am. etc." or "You have attended
during the last six months. Please arrive Tuesday morning at 7:00 a.m."

So, I think your first suggestion is the right way to go. I have both text
boxes created, visible set to "no" and they are on top of each other. Can
you shed some more light on what to do now?

Thank you!


Terry said:
Karla,

Looks like your "paragraphs" are not coming from the data
source.
Two approaches:
If they are the same length or won't affect other stuff on
your report if they are different lengths. Create two text
boxes with the alternate paragraphs and set "Visible"
property to no. Place the two text boxes on top of each
other in the desired location. In the section's format
event set the "visible" property of the appropriate text
box on.

Otherwise create one text box with =iif ([myvalue]
= "A","Paragraph A text","Paragraph B text") I am unsure
how this will treat text strings longer than 255
characters.

Let us know how you go.

HTH

Terry
-----Original Message-----
I'm not sure what you mean by [Paragraph A], [Paragraph B] - do I need to
save these as separate fields within that query or in a separate table? My
paragraphs are pretty lengthy (8-10 sentences long), so I'm sure they will
not fit in a regular field, it would have to be a memo.

Thanks for your help so far!

:



:

I have a report that has a field with either the value A or B. I need to
display one paragraph when the value is "A" and a different paragraph when
the value is "B." There will always be one of these two values in the field.

Is there a way to do this without creating two separate reports - one for
"A" and one for "B"?

Thanks in advance.

You can set this field up in the underlying query if you like.
Go into design view of the query and create a new field...
In the Field Name row type:
VALUE: IIf([Value]="A",[Paragraph A],[Paragraph B])
Run the query to ensure it is working properly and save the query.
Add this new field to your report in design view.
I hope this helps!
.
 
Back
Top