Link to home
Start Free TrialLog in
Avatar of mabo
mabo

asked on

search in DBGRID

here is the question :->
say I have retrieved 100s of rows of data in dbgrid eg names of employees,now I want to find eg John smith , one way to do this is to force the user to look through rows and find it OR we may give them the find option as in MS word, but how can I put the cursor to that particular column matching the search result and make that column highlighted?

any suggestions?
Avatar of MikeP090797
MikeP090797

With only 100 rows you can use Data.recordset.findfirst. Then put the cursor to a column using the col property
Avatar of mabo

ASKER

will this allow wild card search as well?
eg if someone is searching for Smith then SmithField should be
highlighted as well.
any comments?......


You can use any pattern that is valid in recordset's search. When to record is found, no matter what the criteria is, the dbgrid's current record set t the record that was found. Then you just need to put the selection to the column you were searching using the .cols proprty. If you post a specific situation, i will give a sample code.
Avatar of mabo

ASKER

ok, just have a look at the VB5 find facility, it has wild card
match, exact match etc, I am looking for something similar to that.
ASKER CERTIFIED SOLUTION
Avatar of MikeP090797
MikeP090797

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial