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

Update ComboBox based on value in another ComboBox

Status
Not open for further replies.

mshefferVT

Technical User
Jul 9, 2002
5
US
I have a zipcode subtable which has fields labeled ZIP, COUNTY, STATE, and CITY. I want to be able to have a user select the zipcode in one ComboBox and have it update the city in another. What code needs to go in code builder to make this happen?

THanks in advance.
Matt
 
Try this in the Zip AfterUpdate event:

Me![City] = Me![ZIP].Column(1)

Good Luck! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
I am sorry, I made an error (maybe two). If your rowsource has 4 columns with City as the last then the code would be:

Me![City] = Me![Zip].Column(3)
(The columns start with 0 for some reason)

The other thing is, is the second field a combox box also?

And are you trying to add a new record to another table?

Sorry for the confusion.

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top