Access 2010: synchronized combo boxes; how do display what's saved in field?
Posted on 2011-04-21
I have 3 related fields on a form, City, State, and Zip. When zip is entered, the the city and state fields auto populate ... that works. BUT if the user doesn't actually ENTER a zip on the form, the form displays the last state and ciity that was entered. If the user copies the displayed zip and pastes it back, then the city and state fields update. On the form, the zip field is bound to the zip field in the table, but the city and state fields are unbound. Here's the 'after update' code I have:
Private Sub ZIP_AfterUpdate()
Me!City = DLookup("City", "zipcodedatabase", "zip = '" & Me.ZIP & "'")
Me!State = DLookup("State", "zipcodedatabase", "zip = '" & Me.ZIP & "'")
Any ideas? clearly i'm a NEOPHYTE with VB