T
thersitz
Access 2003 on XP
here's my code that ain't working:
Private Sub cboState_AfterUpdate()
Dim ctlListCity As Control
Set ctlListCity = Forms!frmOrgs!sfrmContacts.cboCity
ctlListCity.RowSourceType = "Table/Query"
ctlListCity.RowSource = "SELECT tblCities.cityID, tblCities.city FROM
tblCities WHERE tblCities.stateID=[cboState];"
' Requery source of data for list box.
ctlListCity.Requery
End Sub
Basically, I have an Orgs form and a contacts subform upon it. The contacts
subform has 2 combo boxes -- one for state and the other for city. When the
user selects a state, I want to requery the city combo to fill with only
cities from that state. Is this not working because the control is on a
subform?
here's my code that ain't working:
Private Sub cboState_AfterUpdate()
Dim ctlListCity As Control
Set ctlListCity = Forms!frmOrgs!sfrmContacts.cboCity
ctlListCity.RowSourceType = "Table/Query"
ctlListCity.RowSource = "SELECT tblCities.cityID, tblCities.city FROM
tblCities WHERE tblCities.stateID=[cboState];"
' Requery source of data for list box.
ctlListCity.Requery
End Sub
Basically, I have an Orgs form and a contacts subform upon it. The contacts
subform has 2 combo boxes -- one for state and the other for city. When the
user selects a state, I want to requery the city combo to fill with only
cities from that state. Is this not working because the control is on a
subform?