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

Recommended Answers

All 2 Replies

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.