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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using micrsoft access to create reports

Status
Not open for further replies.

rglover

Technical User
Apr 9, 2003
4
US
I am trying to create an access database for a security company to use. The problem I am having is when it prints out I need it to use various words like, he, she, her, him, his. I have placed a list box for them to choose male or female, I am now having troubles getting access to pull that value from the list box and have the text boxes on the reports show the proper word(he or she). Does anyone know any tips that could possibly help me out.

If you havent already figured it out I am just learning access. I do know VB, but I am not sure how to incorporate the two. Thank you!
 
OK, here are some ideas for you to pursue.

First, I assume that each record has a field (column) to indicate the sex of the person.

You should also have a table (I'll call it the PC table [for "politically correct"] with two records. The first column will contain "male" or "female" (your only permissible values in the sex field of the person table). Other columns will be labeled appropriately and hold the various pronouns you want to use (him, he, his/her, she, hers).

On your report you need a control (I'll call it txtSex) to contain the contents of the sex column. If you don't want to actually display the value on the report, set the visible property of the control to "false". Then, everywhere you need to display the proper pronoun, use DLookup to find the right pronoun.

For example, to get the possessive column (his, hers), build your text with something like this:

"Verify that " & DLookup("[Possessive]","[PC]","[Sex] = '" & me.txtSex & "'") & " salary is high enough."

You'll need the single quotes (') around the criteria in the DLookup statment ([Sex] = ) because it's a text value.

 
Thank you very much, I went through the trouble of figuring this out, using your advice and finishing the project for them to tell me they changed there mind and now I have to start over and do it a different way! darn people! Thank you Though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top