search a wildcard in a record set.

  • Thread starter Thread starter aj
  • Start date Start date
A

aj

i need to find any part of the record in a record set that matches, how do i
incorporate the "*" for this to work?

strFind = "item like """ & txtEzdItemFind & """"

looking to find all like *800T* which will bring up all items with that in
any part is what i am looking for

thanks in advance
brad
 
i need to find any part of the record in a record set that matches, how do i
incorporate the "*" for this to work?

strFind = "item like """ & txtEzdItemFind & """"

looking to find all like *800T* which will bring up all items with that in
any part is what i am looking for

thanks in advance
brad

strFind = "item like "*" & txtEzdItemFind & "*"
 
thanks but something is still wrong with the syntax for me? here is the
complete code it finds no records although when i run a query they all come
up?

Private Sub txtEzdItemFind_AfterUpdate()

Dim db As DAO.Database
Dim rs As Recordset
Dim strFind As String
Dim strPrompt As String
Dim strTitle As String

strFind = "item like " * " & txtEzdItemFind & " * ""

strPrompt = "No records matched your search"

strTitle = "Item Pricing Find"

Set rs = Me.RecordsetClone

With rs
.findfirst strFind
If .nomatch Then
MsgBox strPrompt, , strTitle
txtEzdItemFind.Value = ""

Else
Me.Bookmark = .Bookmark
End If
End With
End Sub
 
thanks but something is still wrong with the syntax for me? here is the
complete code it finds no records although when i run a query they all come
up?

Private Sub txtEzdItemFind_AfterUpdate()

Dim db As DAO.Database
Dim rs As Recordset
Dim strFind As String
Dim strPrompt As String
Dim strTitle As String

strFind = "item like " * " & txtEzdItemFind & " * ""

strPrompt = "No records matched your search"

strTitle = "Item Pricing Find"

Set rs = Me.RecordsetClone

With rs
.findfirst strFind
If .nomatch Then
MsgBox strPrompt, , strTitle
txtEzdItemFind.Value = ""

Else
Me.Bookmark = .Bookmark
End If
End With
End Sub

Sorry, it should be:

strFind = "Item like '" & "*" & txtEzdItemFind & "*'"

For clarity the quotes are like this:
like ' " & " * " & txtEzdItemFind & " * ' "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top