Combo Box Query

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top