How do I set up AutoLookup to automatically fill in fields for me

G

Guest

I'm trying to create a form that automatically fills in the City and State
fields when the user enters a zip code. I have followed microsoft's
directions for creating an AutoLookup query. I have studied the Order form in
Northwind. It works in Northwind, but my creation is a failure. Both fields
I'm looking for remain blank. I can't figure out what I'm missing.
 
G

Guest

there is more than one way to skin this cat.

one way:
On your form make [Zip] a combo/list box that is looking up from a table
that has City, State, Zip columns.

have the combo/list box bound to the zip - have the other two columns there
but you can eliminate their visibility during the zip entry/look up by
changing their unique column size portions to 0"

Back on your form use the AfterUpdate event of [Zip] to fill in the city and
state text boxes on the form. Your code would be something like:
Me.City = Me.Zip.column(2)
Me.State = Me.Zip.column(1)

the column number depends on the order of the columns where it is found in
the Zip combobox....(fyi - the first column may be (0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top