Combo box query problem

Danny B

New member
Local time
Today, 09:20
Joined
Jan 30, 2003
Messages
9
Hiya,

On one of my forms, the user is supposed to select an Estate Agent (the database is a conveyancing properties system) from a pull-down combo box. At the moment, the combo box displays the ID number of each estate agent, since that is the unique key for tblEstateAgents. However, I need it do display the name and town of each estate agent on the system ie. "Foxx and Son, Weymouth", rather than a number (although it still needs to search by the number, while simply displaying the name).

Any ideas on how to do this? I think I need to use SQL but I'm not sure :)

The ID field is EAgentID
The name field is EAgentName
The town field is EAgentTown
The table is tblEstateAgents

Any help here would be cool, thanks
 
Do you have this information running in your query ? If you do, you can show all the data relating to your ID number. Just explain a bit more.

Mike
 
OK, this is the current code for the query run by the combo box:

SELECT tblEstateAgents.EAgentID, tblEstateAgents.EAgentName, tblEstateAgents.EAgentTown
FROM tblEstateAgents
ORDER BY tblEstateAgents.EAgentName;

Now, when I click on the combo box arrow, it still displays the ID number and not the name. Please please tell me how to display the name associated with the ID code, and not the code itself!
 
When you craeted the combo box using the wizard or whatever, you have only selected the ID Field. Create your combo box, select that you want to look up in a table or query, select the table, and then select both the ID and the E name fields. Then store the value for later if you wish. When you run the combo, you select ID, and the Ename will appear next to it.


Mike
 

Users who are viewing this thread

Back
Top Bottom