I have a query (qryParts) with fields Cat (number) and Desc (text). Based on this query is a form called frmParts with the following fields;
cboCat which has a row source from Table tblLUCat. The bound column, 1, is the CatID number, but the user sees column 2, which is the category (Proto, Production, Office...).
cboDesc is a description field that I would like to be able to show a dropdown list of possibilities depending on which category is selected in cboCat.
Here is the code I have tried (a few different ways) but doesn't work. I still get a blank dropdown list for cboDesc.
Private Sub cboCat_AfterUpdate()
Dim strSQL As String
If Me.cboCat = "1" Then
Me.ProtoID = Me.PartsID
Me.lblReturn.Visible = True
More code to make labels etc. visible or not
ElseIf Me.cboCat = "2" Then
More code to make labels etc. visible or not
ElseIf Me.cboCat = "3" Or Me.cboCat = "4" Then
More code to make labels etc. visible or not
End If
strSQL = "SELECT qryParts.Descrip FROM qryParts WHERE qryParts.Cat = " & Me.cboCat
Me.cboDesc.RowSource = strSQL
End Sub
Does someone know how I can fix this?
Thank You