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

Report displays combo box key, not text

Status
Not open for further replies.

samuelNYC

Technical User
Feb 3, 2005
10
US
Hello,

I have a form with several combo boxes, each based on a table. I dutifully included an index as primary key for each table. Seems to work fine in form views, but when I try to display the field as part of a report, the report shows the index (i.e. "2") instead of the text field in the table (i.e. "phone call").

Obviously, the text would be much more helpful for people when I print out the reports. Any ideas on how to make this happen? I'm flummoxed.

Thanks in advance for any help.

Sam
 
Okay, that worked. Thanks dhookom!

A few notes that bear mentioning for the benefit of novices like myself:

My two tables in question were: "tbl_actions" and "tbl_action_type"; I originally created the combo box in a form using the wizard, and in the last step, where it asks you if you want to store the data in a field, I chose a field called "a_action_type" in the tbl_actions table.

On dhookom's advice, I added tbl_action_type to my report (in design view, right-clicking the box to the left of the ruler > properties > record source > "..." > right click > show table) and then created a join between the index key of tbl_action_type and a_action_type in tbl_actions.

However, when I tried to run the report, I got an error message that said "type mismatch in expression;" I guess when I created that field in tbl_actions, I anticipated it being populated with the string, whereas the index field in tbl_action_type is, obviously, a number. While this apparently doesn't matter in my forms, the report didn't like it. Changing the data type of tbl_actions.a_action_type to number fixed the problem.

The report now runs fine.

Thanks again for the help.

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top