I have one table, City, that contains an autonumber field called AddressID. The other fields in that table are text and are City, Township, County, Zip and State. I have 2 combo boxes I'd like to cascade. The first combo box is cboZip, which is text. The info for it comes from the City table. The related combo box is named cboCity and it's info comes from the same table. The user is able to pick or type a zip code in the first combo box and they do get the correct drop down choices for city and the correct AddressID is stored in the table. But when that record is reopened the zip code shows but the city field is blank even though the correct numeral is stored in the table.
Private Sub cboZip_AfterUpdate()
Me.cboCity = Null
Me.cboCity.Requery
Me.cboCity = Me.cboCity.ItemData(0)
End Sub
The event for the City field is
Private Sub cboCity_Enter()
Me.cboCity.Requery
End Sub
I need to store the autonumber field when a city is picked because a city can have multiple zip codes, multiple townships and be in multiple counties. The row source for city is:
SELECT City.AddressID, City.City, City.Township, City.County, City.Zip FROM City WHERE (((City.Zip)=[Forms]![Navigation Form]![NavigationSubform].[Form]![Zip])) ORDER BY City.City;
This is driving me nuts. I'd appreciate any help I can get.
Thanks.
Private Sub cboZip_AfterUpdate()
Me.cboCity = Null
Me.cboCity.Requery
Me.cboCity = Me.cboCity.ItemData(0)
End Sub
The event for the City field is
Private Sub cboCity_Enter()
Me.cboCity.Requery
End Sub
I need to store the autonumber field when a city is picked because a city can have multiple zip codes, multiple townships and be in multiple counties. The row source for city is:
SELECT City.AddressID, City.City, City.Township, City.County, City.Zip FROM City WHERE (((City.Zip)=[Forms]![Navigation Form]![NavigationSubform].[Form]![Zip])) ORDER BY City.City;
This is driving me nuts. I'd appreciate any help I can get.
Thanks.