I have 2 combo boxes: 'Division' and 'location'. I want to select a 'division' and have the locations associated with that division be the rowsource for the 'location' combo box (limit the list).
This is for same table source data, table "DivLoc", columns: are DivLocID, Division, Location
Division combo box: cmbDivsion
I have the property for record source set as a query. This query gives the distinct values for divison. This combo box lists the correct results.
Location combo box: cmbLocation
On the 'after update' event of cmbDivision, I have put in the following code:
cmbLocations.Ro wSource = "SELECT DL.[Location] FROM DivLoc DL WHERE DL.Division = '" & cmbDivisions.va lue & "' order by DL.Location"
I do not get any values returned in the locations combo box. However, I can run the select statement alone and I get values. I can not figure out what I am doing wrong to prevent the locations values from being displayed as the rowsource.
Any suggestions would be appreciate. I have look at several posts on this forum and it looks like I have followed the same method.
This is for same table source data, table "DivLoc", columns: are DivLocID, Division, Location
Division combo box: cmbDivsion
I have the property for record source set as a query. This query gives the distinct values for divison. This combo box lists the correct results.
Location combo box: cmbLocation
On the 'after update' event of cmbDivision, I have put in the following code:
cmbLocations.Ro wSource = "SELECT DL.[Location] FROM DivLoc DL WHERE DL.Division = '" & cmbDivisions.va lue & "' order by DL.Location"
I do not get any values returned in the locations combo box. However, I can run the select statement alone and I get values. I can not figure out what I am doing wrong to prevent the locations values from being displayed as the rowsource.
Any suggestions would be appreciate. I have look at several posts on this forum and it looks like I have followed the same method.
Comment