ADO Search Record Function
Can anyone show me the general code for a serch function? Here is the scenario:
In a Product form, it contains Product Name, Unit Price. After a "search" button is clicked and input box will be displayed. This "Search" function is based on "Product Id". after "product Id" is entered, The program will find the corresponding record and display it on the Product form. The database is linked using ADODC. Please let me know how to code this program.
Re: ADO Search Record Function
The best way to perform sewrch is to use SQL. Enetr your RecordID to the input box and then execute the SQL
Save your input into variable
dProductID if it is a number
sProductID if it is a string
a.Number
sSQL = "select * from YourTable where ProductID = " & dProductID
b.String
sSQL = "select * from YourTable where ProductID = '" & sProductID & "'"
adodc1.DtaSource = sSQL
Iouri Boutchkine
[email protected]
Re: ADO Search Record Function
adodc1.recordset.find "Product Id='" & productid & "'"
Re: ADO Search Record Function
So, after performing finding, i wish to know if this recrd exists in my database. What shall i do next?