G
Guest
I have (2) combo boxes and (1) text box set-up to filter out my form. I am
using the following code.
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilteronDate) Then
strWhere = strWhere & "([Date]= ""#" & Me.FilteronDate & " # "") And "
End If
If Not IsNull(Me.FilterOnShift) Then
strWhere = strWhere & "([ShiftID] = """ & Me.FilterOnShift & """) And "
End If
If Not IsNull(Me.FilterProcessLine) Then
strWhere = strWhere & "([LineID]= """ & Me.FilterProcessLine & """) And"
End If
lngLen = Len(strWhere) - 5
If lngLen > 0 Then
strWhere = Left$(strWhere, lngLen)
End If
The FilterOnShift and FilterOnLine fields are both numeric fields. I can't
seem to get the syntax correct for these statement and I'm getting the
following error:
Missing),], or Item in query expression '([ShiftID]="2") And ([LineID]="2"".
Can someone please help me with the syntax.
Thanks...
using the following code.
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtFilteronDate) Then
strWhere = strWhere & "([Date]= ""#" & Me.FilteronDate & " # "") And "
End If
If Not IsNull(Me.FilterOnShift) Then
strWhere = strWhere & "([ShiftID] = """ & Me.FilterOnShift & """) And "
End If
If Not IsNull(Me.FilterProcessLine) Then
strWhere = strWhere & "([LineID]= """ & Me.FilterProcessLine & """) And"
End If
lngLen = Len(strWhere) - 5
If lngLen > 0 Then
strWhere = Left$(strWhere, lngLen)
End If
The FilterOnShift and FilterOnLine fields are both numeric fields. I can't
seem to get the syntax correct for these statement and I'm getting the
following error:
Missing),], or Item in query expression '([ShiftID]="2") And ([LineID]="2"".
Can someone please help me with the syntax.
Thanks...