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

Open recordset behind form

Status
Not open for further replies.

tsonnenl

Programmer
Apr 8, 2002
65
0
0
US
Hi-
Potentially very simple question here...I want the city name to be put into a textbox on a form when the corresponding zip code is entered. I have a table "Zipcodes" that contains the fields "zip" and "city."
The creation of the recordset is what is giving me trouble. I have tried a few things that I read on this and other forums, but all have given me errors to this point which leads me to believe that there is a much easier way.

Thanks in advance.
Todd
 
On the exit of the txtZip field you can put the following

if not(Me!txtZip = "" OR isnull(Me!txtZip)) then
txtCity = dlookup("[city]", "ZipCodes", "[zip] = " & Me!txtZip)
end if

HTH,

Jude
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top