I found this interesting and was wondering if it could be expended a bit.
My table of zip codes has Primary City Name [PrimaryCityName] and Acceptable City Names [AcceptableCityN ames]. I'd like for the code to change the [City] control on the form to an option drop down showing the alternative Acceptable City Names that the user could then select from. The acceptable city names are stored comma separated so sometimes they will have multiple acceptable city names to select from. Both are Short Text data types.
Here is my code pulling just the three things I want to use but I don't know how to code the options part of it.
Thanks,
Terry
My table of zip codes has Primary City Name [PrimaryCityName] and Acceptable City Names [AcceptableCityN ames]. I'd like for the code to change the [City] control on the form to an option drop down showing the alternative Acceptable City Names that the user could then select from. The acceptable city names are stored comma separated so sometimes they will have multiple acceptable city names to select from. Both are Short Text data types.
Here is my code pulling just the three things I want to use but I don't know how to code the options part of it.
Code:
Private Sub ZIP_Code_AfterUpdate()
City = DLookup("PrimaryCityName", "tblZipCodes", "ZipCode = '" & Me.[ZIP Code] & "'")
State = DLookup("StateCode", "tblZipCodes", "ZipCode = '" & Me.[ZIP Code] & "'")
Country = DLookup("Country", "tblZipCodes", "ZipCode = '" & Me.[ZIP Code] & "'")
End Sub
Terry
Comment