Combo Box

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

Guest

I have recently taken over a database designed by someone else. I would like
to make a report using a combo box that was set up using a # to identify a
field. I would like to show the value instead of the # in my report (eg.
1=Female, 2=Male).When I create the query only the number shows. How do I do
this. I would like to keep the # for inputing as it is easier than typing in
the value.
Any help is greatly appreciated. Thanks. Jamie
 
Jamie

Add a field into your query. Use the IIF() function to derive "Male" or
"Female", based on the #.

Use that new field instead of the # field.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jamie,
Formatting Male for a 1 and Female for a 2 on a report will not have any effect on how
you enter the 1 or 2 on your form. So, no worry on that.

Assuming a field called Gender with numeric values of either 1 or 2...
On your report, place an unbound text control with a ControlSource of...

= IIF(Gender = 1, "Male", "Female")

Now instead of displaying the Gender number you'll get "Male or "Female"

And... don't forget options for 3 = "Transgender" or 4 = "Not Sure".... :-D
 
I have recently taken over a database designed by someone else. I would like
to make a report using a combo box that was set up using a # to identify a
field. I would like to show the value instead of the # in my report (eg.
1=Female, 2=Male).When I create the query only the number shows. How do I do
this. I would like to keep the # for inputing as it is easier than typing in
the value.
Any help is greatly appreciated. Thanks. Jamie

Use an unbound text control.
=IIf([FieldName] = 1,"Female","Male")

If there is a chance that neither has been selected:
=IIf([FieldName] = 1,"Female",IIf([FieldName] = 2,"Male","Not
Selected"))
 
Back
Top