Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional value in textbox

Status
Not open for further replies.

Thingol

Technical User
Jan 2, 2002
169
Hi All,

I have a contacts database, and want to create a report to display the results from a custom query. The field "Gender" contains either one of the values "Male", "Female" or "Unknown". Since the report is use as layout for letters, I would like to use the Gender field to create a salutation, i.e. "Sir" for "Male", "Madam" for "Female" and "Madam/Sir" for "Unknown".

How could I do this best? I've been trying lots of stuff, including update queries, but that won't work, since they change the original records (n.g. from "Male" to "Sir").

I hope you can help.

Best regards,
Martijn Senden.

In the Beginning there was nothing, which exploded.

--Terry Pratchett, Lords and Ladies--
 
Code:
=iif([Gender] = "Male", "Dear Sir", iif([Gender] = "Female", "Dear Madam", "Dear Madam/Sir"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top