0

If I hard code search criteria i.e.

adodc1.recordset.find "car Like 'corvete'"

will work. But if i try to use an entered sting
in text box on a form and assign it to a string
variable with wildcards in the "find" it does not work.

WORKS:

Dim test As String
test = text6.Text
Adodc1.Recordset.Find "[car] LIKE '" & test & "'" 'Works

'hard coded not using info entered from text box
Adodc1.Recordset.Find "[car] LIKE 'Corvette'" 'WORKS

DOESN'T WORK:

Adodc1.Recordset.Find "[car] LIKE 'test*'" 'DOES NOT WORK

I want them to enter which car is their preference but not have
to enter the full name hence the need for the wildcard. The problem
seems to arise when looking for an incomplete string entered in a text
boxe on a form to a comparable record using wildcard "*" .

Anyone have the answer or a workaround solution? Thanks

2
Contributors
2
Replies
6
Views
7 Years
Discussion Span
Last Post by kinwang2009
0

Solved my own problem. Looks like alot of people are
having this problem. To take a partial sting entered in
a text box on a form and "FIND" the complete string in the
recordset, use this

Adodc1.Recordset.Find "[CAR] LIKE '*" & test & "*'"

P.S. I didn't want to just leave this out there once I got it.

0

Congratulations!!! You have solved your problem but please mark this thread as Solved so that people having same problem can use your thread as you have mentioned.
Thanks

Edited by kinwang2009: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.