Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wildcards

Status
Not open for further replies.

rozzay

Programmer
Jan 3, 2002
142
0
0
US
Hi I am in need of some help. I have a code below:

strStoreVdr = "'" & txtFind.Text & "%" & "'"
rsUsrAcc.Find "[vendor_name] like " & strStoreVdr

this works fine but when I come across a text where not much similar the record becomes eof and error. For example user types in 'p' and in my record there is no vendor name starting with 'p' it would become end-of-file and would not load the data. I need it where if there is no 'p' then go to 'q' and so on.

thanks in advance.
 
Using the find function causes VB to loop through the recordset until it finds something that meets your criteria. If nothing is found it goes to EOF.

For something as complex as you are doing, I think you will have to sort the rs and then move through it until you find where you want to be. Then load the data that you need.

Otherwise you can test for eof and then manually change the search criteria so that you can search again.

Those are the two solutions that I can come up with.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top