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

Printing full name of an abbreviated state name

Status
Not open for further replies.

MissTinSC

Technical User
Apr 7, 2003
11
0
0
US
I have a database that uses postal abbreviations for states: az, ak, sc, etc. The user keys in the abbreviations. I am creating a report that lists alumni organized by state. I would like to be able to head each state section with the FULL name of the state (az- Arizona, etc). Is there a way to do this? If so, What would the code be and where would I put it?

Thanks for you help.
MissTinSC
 
A State table with the abbreviation and the full name would allow you lookup the desired information. Then a field on your report's state header could contain something along the lines of:
=Dlookup("[StateName]","StateTbl","[StateAbb]='"&[AlumniTbl]![State]&"'")

Let them hate - so long as they fear... Lucius Accius
 
Alernatively, you could use a combobox with an SQL statement that linked the main table with the look-up table.
 
The most efficient method is to have a table of state abbreviations and names. Add this table to your report's record source and join the abbreviation fields. Add the state name to the grid to make it available in the report.

Code and DLookup() add a lot of un-necessary overhead and work. Combo boxes are more often used on forms but can be easily implemented on the report.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top