P
PHuser
I have copied Allen Browne's Search DB But I keep getting the error "You
Can't assign a value to this object" and highlights the Me.Filter = strWhere
What am I doing wrong? And I do have 1 question in a query you can use the
"Like" command when looking up a number how come it can't be used for this?
I have tried both.
Private Sub CmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.InvNumber) Then
strWhere = strWhere & "([PONumber] Like "" * " & Me.InvNumber & " *
"") AND"
End If
If Not IsNull(Me.InvAmount) Then
strWhere = strWhere & ([txtTotal] Like "*" & Me.InvAmount & "*")
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
Can't assign a value to this object" and highlights the Me.Filter = strWhere
What am I doing wrong? And I do have 1 question in a query you can use the
"Like" command when looking up a number how come it can't be used for this?
I have tried both.
Private Sub CmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.InvNumber) Then
strWhere = strWhere & "([PONumber] Like "" * " & Me.InvNumber & " *
"") AND"
End If
If Not IsNull(Me.InvAmount) Then
strWhere = strWhere & ([txtTotal] Like "*" & Me.InvAmount & "*")
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub