After reading through the forums I saw some code on how to auto populate unbound controls on a form. However, I don't quite understand the code. Could someone explain to me where I put what.
Use a Dlookup on the Afterupdate event:
Me.[field name to be populated] = Dlookup("Field", "Table", "Field ='" & me.[Fieldname] & "'")
Also add an unbound textbox (you can lock it if you want, so it can't be changed).
So I have an unbound field called City and I want it to populate the unbound field called zip code. Here is what I wrote, but it does not work.
me.[zipcode]=Dlookup("zipcode", "Employees", "city='" & me.[city] & "'")
Can anyone tell me what I am doing wrong here? I wrote this on the unbound field called City.