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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ado search field??

Status
Not open for further replies.

darreldk

Programmer
Aug 22, 2002
9
0
0
US
Could anyone direct me to a good tutorial for putting a search field in my ado database?
What i want to do is have a search field on form1 and have it populate a the record on form2 with the results. Any help would be greatly appriated
 
There is an ADO tutorial at and you can see if there are any at
I think that all you need to do is build an SQL statement and include the parameter from form1. This should return the recordset that you are after for form2. Thanks and Good Luck!

zemp
 
Thank you for the help, I don't suppose you could give me a little example of including parameters in a sql statement?
 
Basically you will be using an SQL statement and then adding a Where clause with you parameter. If your parameter is a string,

Select * From Table1 Where Field1='" & strVariable & "'"

If it is a number, drop the single quotes that surround the variable,

Select * From Table1 Where Field1=" & intVariable

The variable can be a text box as well, Just make sure that you do any data type conversion if they are necessary.

You can take a look at thread709-409184 for an example and discussion of potential problems. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top