K
Karl H
rHi,
I have a form with demographics based on one table, but I would like to
incorporate another table of user-defined city & zip codes so the
demographics form can "auto-fill" the state & Zip, but have the data entered
in the demographics table.
I thought I could put in some code, "after update" that looks for the city
on the current form and compares it to the city in tblCity. If the city is
found, it would fill in the State & Zipcode fields in the demographics form
with the corresponding data from tblCity.
Private Sub txtCity_AfterUpdate()
Dim cInt As Interger
If txtCity = Tables.tblCity.FindFirst.[City] Then
cInt = [ID] (of same recordset for this table)
txtState = Tables.tblCity.[State]
txtZip = Tables.tblCity.[Zip]
Else exit sub
End if
End Sub
I know I'm missing some important means of linking the recordset of the
second table.
Thank you in advance for your help!
Karl
I have a form with demographics based on one table, but I would like to
incorporate another table of user-defined city & zip codes so the
demographics form can "auto-fill" the state & Zip, but have the data entered
in the demographics table.
I thought I could put in some code, "after update" that looks for the city
on the current form and compares it to the city in tblCity. If the city is
found, it would fill in the State & Zipcode fields in the demographics form
with the corresponding data from tblCity.
Private Sub txtCity_AfterUpdate()
Dim cInt As Interger
If txtCity = Tables.tblCity.FindFirst.[City] Then
cInt = [ID] (of same recordset for this table)
txtState = Tables.tblCity.[State]
txtZip = Tables.tblCity.[Zip]
Else exit sub
End if
End Sub
I know I'm missing some important means of linking the recordset of the
second table.
Thank you in advance for your help!
Karl