Displaying field on report from combox box

G

Guest

I'm printing a report from a form and I have a combo box that selects the
type of animal being released...D=Dog,C=Cat,O=Other. I would like to print
the word out on the form instead of just the first letter. I tried using an
unbound text field and using the following statement as the control source:
IIf([AnimalType]="D","Dog","")
but, I keep getting the #Error message. All the other fields print fine,
just the two that are based on combo boxes don't print at all. Any help or
suggestions would be appreciated.
Thanks,
Randy M
 
G

Guest

If the cpmbobox data is from a table just add it to the query that is the
records source for the report. Join on the ID and add the narrative field to
the query.
 
G

Guest

Karl,
I'm relatively new to Access and I'm slowly working my way through. The
data is from a table, but it is already in the query that the report is based
on. I guess what I have is a one character field in the table that has either
a "D","C", or "O" in it. I need to be able to print the whole word on the
report based on this letter. In Cobol I could do it with an IF THEN ELSE, but
I'm not sure how you do this in Access. It looks like it will only allow one
IIF in the control source property of the text box. If you can shed some
light, I'd appreciate it. It seems everytime I think I see the light at the
end of the tunnel, it's really just another train. Thanks for you help.

Randy M

KARL DEWEY said:
If the cpmbobox data is from a table just add it to the query that is the
records source for the report. Join on the ID and add the narrative field to
the query.

WCDoan said:
I'm printing a report from a form and I have a combo box that selects the
type of animal being released...D=Dog,C=Cat,O=Other. I would like to print
the word out on the form instead of just the first letter. I tried using an
unbound text field and using the following statement as the control source:
IIf([AnimalType]="D","Dog","")
but, I keep getting the #Error message. All the other fields print fine,
just the two that are based on combo boxes don't print at all. Any help or
suggestions would be appreciated.
Thanks,
Randy M
 
G

Guest

If you only have three then it is easy to use the IIF statement. Open the
query in design view and add this as a column.
Animal: IIf([AnimalType]="D","Dog",IIf([AnimalType]="C","Cat","Other"))

WCDoan said:
Karl,
I'm relatively new to Access and I'm slowly working my way through. The
data is from a table, but it is already in the query that the report is based
on. I guess what I have is a one character field in the table that has either
a "D","C", or "O" in it. I need to be able to print the whole word on the
report based on this letter. In Cobol I could do it with an IF THEN ELSE, but
I'm not sure how you do this in Access. It looks like it will only allow one
IIF in the control source property of the text box. If you can shed some
light, I'd appreciate it. It seems everytime I think I see the light at the
end of the tunnel, it's really just another train. Thanks for you help.

Randy M

KARL DEWEY said:
If the cpmbobox data is from a table just add it to the query that is the
records source for the report. Join on the ID and add the narrative field to
the query.

WCDoan said:
I'm printing a report from a form and I have a combo box that selects the
type of animal being released...D=Dog,C=Cat,O=Other. I would like to print
the word out on the form instead of just the first letter. I tried using an
unbound text field and using the following statement as the control source:
IIf([AnimalType]="D","Dog","")
but, I keep getting the #Error message. All the other fields print fine,
just the two that are based on combo boxes don't print at all. Any help or
suggestions would be appreciated.
Thanks,
Randy M
 
G

Guest

Karl,
I really do appreciate you're taking the time to try and help me and I
apologize for being such a pest, but I'm not sure if I understand your
answer. I went to the query, at least I think it's the query, it's in the
reports record source property where there's a select statement,...anyhow, I
added the field Animal in a column and then put the IIf statement in the
criteria. Now, it asks for the Animal parameter when I open the report. As I
said, I'm relatively new to Access, so something that might be very simple
for you to see, it's not quite that clear to me yet. Again, I apologize for
being so thick-headed, but I'm still at the 'newbie' stage. Again, thank you
for taking time to try and help me out.
Randy M

KARL DEWEY said:
If you only have three then it is easy to use the IIF statement. Open the
query in design view and add this as a column.
Animal: IIf([AnimalType]="D","Dog",IIf([AnimalType]="C","Cat","Other"))

WCDoan said:
Karl,
I'm relatively new to Access and I'm slowly working my way through. The
data is from a table, but it is already in the query that the report is based
on. I guess what I have is a one character field in the table that has either
a "D","C", or "O" in it. I need to be able to print the whole word on the
report based on this letter. In Cobol I could do it with an IF THEN ELSE, but
I'm not sure how you do this in Access. It looks like it will only allow one
IIF in the control source property of the text box. If you can shed some
light, I'd appreciate it. It seems everytime I think I see the light at the
end of the tunnel, it's really just another train. Thanks for you help.

Randy M

KARL DEWEY said:
If the cpmbobox data is from a table just add it to the query that is the
records source for the report. Join on the ID and add the narrative field to
the query.

:

I'm printing a report from a form and I have a combo box that selects the
type of animal being released...D=Dog,C=Cat,O=Other. I would like to print
the word out on the form instead of just the first letter. I tried using an
unbound text field and using the following statement as the control source:
IIf([AnimalType]="D","Dog","")
but, I keep getting the #Error message. All the other fields print fine,
just the two that are based on combo boxes don't print at all. Any help or
suggestions would be appreciated.
Thanks,
Randy M
 
G

Guest

I went to the query, at least I think it's the query, it's in the reports
record source property where there's a select statement,...
No that is not the query. A select statement in the reports record source
property is not a query. A name of query in the reports record source
property would be a query.
Go to database view and you will see icon on the left for Objects --
Tables
Queries
Forms
Reports
etc

Click on Queries and then New. Here is where you create queries.

WCDoan said:
Karl,
I really do appreciate you're taking the time to try and help me and I
apologize for being such a pest, but I'm not sure if I understand your
answer. I went to the query, at least I think it's the query, it's in the
reports record source property where there's a select statement,...anyhow, I
added the field Animal in a column and then put the IIf statement in the
criteria. Now, it asks for the Animal parameter when I open the report. As I
said, I'm relatively new to Access, so something that might be very simple
for you to see, it's not quite that clear to me yet. Again, I apologize for
being so thick-headed, but I'm still at the 'newbie' stage. Again, thank you
for taking time to try and help me out.
Randy M

KARL DEWEY said:
If you only have three then it is easy to use the IIF statement. Open the
query in design view and add this as a column.
Animal: IIf([AnimalType]="D","Dog",IIf([AnimalType]="C","Cat","Other"))

WCDoan said:
Karl,
I'm relatively new to Access and I'm slowly working my way through. The
data is from a table, but it is already in the query that the report is based
on. I guess what I have is a one character field in the table that has either
a "D","C", or "O" in it. I need to be able to print the whole word on the
report based on this letter. In Cobol I could do it with an IF THEN ELSE, but
I'm not sure how you do this in Access. It looks like it will only allow one
IIF in the control source property of the text box. If you can shed some
light, I'd appreciate it. It seems everytime I think I see the light at the
end of the tunnel, it's really just another train. Thanks for you help.

Randy M

:

If the cpmbobox data is from a table just add it to the query that is the
records source for the report. Join on the ID and add the narrative field to
the query.

:

I'm printing a report from a form and I have a combo box that selects the
type of animal being released...D=Dog,C=Cat,O=Other. I would like to print
the word out on the form instead of just the first letter. I tried using an
unbound text field and using the following statement as the control source:
IIf([AnimalType]="D","Dog","")
but, I keep getting the #Error message. All the other fields print fine,
just the two that are based on combo boxes don't print at all. Any help or
suggestions would be appreciated.
Thanks,
Randy M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top