By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,058 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,058 IT Pros & Developers. It's quick & easy.

search

lee123
100+
P: 556
I have a form on which I want to search and find a company name in a datagrid. The button I have I have named cmdsearch but the code to use the "find" I don't understand it. So if someone could explain how to use this method it would be great:

object.find(criteria[,skiprows][,searchdirection][,start])

adodc is run by an Access database (2000).

lee123
Dec 29 '07 #1
Share this Question
Share on Google+
8 Replies


daniel aristidou
100+
P: 491
I have a form on which I want to search ...
Could you please state which version of VB you use?
Dec 29 '07 #2

lee123
100+
P: 556
yes i can i am using vb6.0

lee123
Dec 29 '07 #3

daniel aristidou
100+
P: 491
i am using vb6.0

lee123
Could you also post which datagrid you are using eg microsoft datagrid 6
Since each datagrid uses different methods
Dec 29 '07 #4

lee123
100+
P: 556
yea it's datagrid 6.0 i hope that helps.

lee123
Dec 29 '07 #5

lee123
100+
P: 556
ok i have entered this in the button:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CmdSearch_Click()
  2.     Dim strcompanyname As String
  3.     strcompanyname = InputBox("Enter In A CompanyName Please")
  4.     Adodc1.Recordset.Find "Companyname= '" & strcompanyname & "'"
  5. End Sub
but when i search for a record it only searches down and not up. how do i get it to search both ways.

lee123
Dec 30 '07 #6

Expert 5K+
P: 8,434
Not really familar with ADODC, but perhaps you need to do something like MoveFirst before starting the search, so it starts form the beginning. The nice thing about this, of course, is that by not going to the start, you can easily do a "find next" function.
Dec 31 '07 #7

lee123
100+
P: 556
Hey that will work. You know I should of thought of that but I didn't. Thanks killer42 you really are good at this.

lee123
Dec 31 '07 #8

Expert 5K+
P: 8,434
Thanks for that. I'm just glad we could help.
Dec 31 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.