G
Guest
I am trying to populate an Access 2003 form field based on the input from
another field on the form. Basically I want to draw the location sector of
town based on the zipcode. I have a table:
tblLocationByZip
-------------------
intzip
txtlocation
and I want the form to populate the location field on the customer table
from the location control using dlookup after typing the zip code into the
zip control.
tblCustomer
----------------
.....addr
txtcity
txtstate
intzip
txtlocation ....
I am using afterUpdate_zip
Me![txtlocation] = DLookup("[txtlocation]", "tblLocationByZip", "[intzip]="
& Me![intzip])
I seem to be always returning the 1st record of the tblLocationByZip
regardless what I put in the zip field.
I am sure I am missing something silly but can't seem to get it right.
Perhaps dlookup is not the proper function to use.
another field on the form. Basically I want to draw the location sector of
town based on the zipcode. I have a table:
tblLocationByZip
-------------------
intzip
txtlocation
and I want the form to populate the location field on the customer table
from the location control using dlookup after typing the zip code into the
zip control.
tblCustomer
----------------
.....addr
txtcity
txtstate
intzip
txtlocation ....
I am using afterUpdate_zip
Me![txtlocation] = DLookup("[txtlocation]", "tblLocationByZip", "[intzip]="
& Me![intzip])
I seem to be always returning the 1st record of the tblLocationByZip
regardless what I put in the zip field.
I am sure I am missing something silly but can't seem to get it right.
Perhaps dlookup is not the proper function to use.