Set combo type/rowsource
I’m trying to set the row source type and rowsource of a combo box based upon the selection made in a previous combo but right now I keep getting the error that the “data type mismatch in criteria expression” This happens when I use the first combo, and then goto the 2nd combo to see my filtered list. I’m pretty certain I’m referencing the correct fields as well. I’d appreciate any advice. Please advise.
Here’s the code I placed in the afterUpdate event of the first combo that is meant to filter the rowSource of the 2nd combo:
Dim strSQL As String
strSQL = "SELECT
RetailerNumber,RetailerStoreNumber,StoreName,Address1,Address2,City,Province,PostalCode,RegionCode FROM tblRetailerStore WHERE RetailerNumber =" & Right(Me.Code.Column(0), 5)
Me.cboDealer.RowSourceType = "Table/Query"
Me.cboDealer.RowSource = strSQL
I’m trying to set the row source type and rowsource of a combo box based upon the selection made in a previous combo but right now I keep getting the error that the “data type mismatch in criteria expression” This happens when I use the first combo, and then goto the 2nd combo to see my filtered list. I’m pretty certain I’m referencing the correct fields as well. I’d appreciate any advice. Please advise.
Here’s the code I placed in the afterUpdate event of the first combo that is meant to filter the rowSource of the 2nd combo:
Dim strSQL As String
strSQL = "SELECT
RetailerNumber,RetailerStoreNumber,StoreName,Address1,Address2,City,Province,PostalCode,RegionCode FROM tblRetailerStore WHERE RetailerNumber =" & Right(Me.Code.Column(0), 5)
Me.cboDealer.RowSourceType = "Table/Query"
Me.cboDealer.RowSource = strSQL