DBApprentice
On Error GoTo AWF *****:
- Local time
- Today, 18:55
- Joined
- Dec 24, 2018
- Messages
- 150
Hi!
I am having a hard time with this string:
The user should enter the number on a unbound textbox on form and I want to use the LIKE operator plus the wildcard * but I get an error on the WHERE clause when I run this code:
_
What is the right syntax for the LIKE + wildcard on a number value?
Thanks,
I am having a hard time with this string:
Code:
Dim strSQL As String
strSQL = "SELECT tbl1Cards.CardID, tbl1Cards.CardNumber, StatusCard AS Status, tbl1Categories.Category, tbl1Observers.[FirstName] & "" "" & [MiddleName] & "" "" & [Lastname] AS FullName " _
& "FROM tbl1Categories INNER JOIN (tbl1StatusCard INNER JOIN (tbl1Observers INNER JOIN tbl1Cards ON tbl1Observers.ObserversID = tbl1Cards.ObserverFK) ON tbl1StatusCard.StatusCardID = tbl1Cards.StatusCardFK) ON tbl1Categories.CategoryID = tbl1Cards.CategoryFK " _
& "WHERE [tbl1Cards.CardNumber] LIKE [ " & "*" & Me.txtSearchcard & " ] " _
& "ORDER BY tbl1Cards.ObservationOn DESC; "
Me.subFindcards.Form.RecordSource = strSQL
Me.subFindcards.Form.Requery
The user should enter the number on a unbound textbox on form and I want to use the LIKE operator plus the wildcard * but I get an error on the WHERE clause when I run this code:
Code:
"WHERE [tbl1Cards.CardNumber] LIKE [ " & "*" & Me.txtSearchcard & " ] "
What is the right syntax for the LIKE + wildcard on a number value?

Thanks,