Hi, Hoping some kind person can help me with this piece of code.
I am trying to concatenate multiple string criteria to make a table search filter. From combo box choices I can make each criteria but can't work out how to join them - see line in blue.
I have tried BuildCriteria but the second filter field name is enclosed in "" not [] so it doesn't work
Private Sub cbEmployeeName_AfterUpdate()
strName = ""
strName = Me.cbEmployeeName.Column(0)
End Sub
__________________________________________________ __
Private Sub cbEqID_AfterUpdate()
strEquip = ""
strEquip = Me.cbEqID.Column(0)
End Sub
__________________________________________________ _____
Private Sub coPreviewWOReport_Click()
On Error GoTo Err_coPreviewWOReport_Click
filterName = ""
filterEquip = ""
strCriteria = ""
Dim stDocName As String
stDocName = "WOListing"
If Not IsNull(strName) Then
filterName = "[EmployeeID]='" & strName & "'"
End If
If Not IsNull(strEquip) Then
filterEquip = "[EqID]='" & strEquip & "'"
End If
'strCriteria = How do I join filterName "AND" filterEquip
DoCmd.OpenReport stDocName, acPreview, , strCriteria
Exit_coPreviewWOReport_Click:
Exit Sub
Err_coPreviewWOReport_Click:
MsgBox Err.Description
Resume Exit_coPreviewWOReport_Click
End Sub