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

Populating combo box based on value of another from table

Status
Not open for further replies.

Imbriani

Programmer
Jan 9, 2004
195
US
Hi all,

I have a table with two columns, CountyId and County name. I want to have a text box on a form into which is typed a county Id number and then have the Name of the county appear in another text box, both drawing from this table. As simple as this sounds, I have been unable to find my code for this and I haven't used Access for a while. Advice would be so appreciated.
 
You can use DlookUp in the second textbox.

[tt]=DlookUp("[County name]","County Table","CountyId=" & Me.Textbox1)[/tt]

Have you considered a combobox?
 
In this case, the user is used to doing it another way in a now-defunct front end. She would type in a code number, say 135 and in another field to be stored in the DB up would pop the name of the county, say "Wayne". It's just a way to make her job easier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top