I have a form that has 3 possible search criteria.
ItemID
Category
Description
The user can enter one or all three to search on. It needs to find the closest match.
The SQL statement I am runnning looks like this.
When I stop at the itemid and category, the findfirst works just fine. However, it does not like the description added to it.
I am stumped. Description field is string (just like category) and there is nothing I can see. The category is more likely to have data in it, whereas description is likely to be null.
Any suggestions? Is there something wrong with the code, or should I be looking somewhere else for the issue? Any help would be appreciated.
ItemID
Category
Description
The user can enter one or all three to search on. It needs to find the closest match.
The SQL statement I am runnning looks like this.
Code:
If Me.txtSearchCategory = "" Then
Me.txtSearchCategory = "*"
end If
If Me.txtSearchDesc = "" Then
Me.txtSearchDesc = "*"
End If
If Me.txtSearchItemID = "" Then
Me.txtSearchItemID = "*"
End If
strSQL = "itemid like '" & Me.txtSearchItemID & "' and " & _
"category like '" & Me.txtSearchCategory & "' and " & _
"description like '" & Me.txtSearchDesc & "'"
frmInfoItems.dataInfoItem.Recordset.FindFirst strSQL
When I stop at the itemid and category, the findfirst works just fine. However, it does not like the description added to it.
I am stumped. Description field is string (just like category) and there is nothing I can see. The category is more likely to have data in it, whereas description is likely to be null.
Any suggestions? Is there something wrong with the code, or should I be looking somewhere else for the issue? Any help would be appreciated.