Combo Box Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can create a combo box to select a field value eg, Regions

The field value has a number of sub categories eg, Cities in the Region

How can I create another field that will allow me to select only the cities
associated with the selected region.

RegionA: Cities L,M,N,O or P
RegionB: Cities W,X,Y or Z
 
Assuming that cboRegion lists all the regions and cboCity - all the Cities
related to the selected Region.
Private Sub cboRegion_AfterUpdate()
Me.cboCity.RowSource = "SELECT City_Id,Name FROM tblCities Where
Region_Id = " & Me.cboRegion.Column(0) & ";"
Me.cboCity.SetFocus
Me.cboCity.Requery
End Sub
 
Back
Top