combobox example:
the columns in the combo would be:
zip
city
state
to get the city and state of the selected zip do this onexit, ondblclick or
whenever you need to set city and state
ctlCITYSTATE = ctlzipcode.column(1) & ", " & ctlzipcode.column(2) ' it's
zero based
code example
dim myset as recordset
set myset = currentdb().openrecordset("select city, state form ZipCodes
where zipcode = '" & ctlzipcode & "'",dbopensnapshot)
if myset.recordcount = 0 then
msgbox ctlzip & " is not on file"
else
ctlcitystate = myset!city & ", " & myset!state"
endif
close, etc.
John Bickmore
www.BicycleCam.com www.Feed-Zone.com
"Bob" <Bo*******@att.net> wrote in message
news:kn***********************@bgtnsc04-news.ops.worldnet.att.net...
I have a form with controls City and Zip Code, and a Table containing Zip
Code with the corresponding City. I would like the user to just enter Zip
Code, either by typing or with a combo box; then have the city set
automatically. Any advice on how to do this would be appreciated.