PDA

Click to See Complete Forum and Search --> : Retrieving records


bdanney
Oct 31st, 2001, 04:52 AM
Hi all

I am almost sure someone will be able to help me out with the following problem:

I have 3 text boxes that pull info from a database. What needs to happen is that in the first text box the user will type in a number. Next using the number from the first text box the database will find the record and display info in the other two text boxes.

What I need to know is how do I get the app to search the database from the info in the first text box and then display the record information in the other two text boxes ?

Sorry. I am using ADO to connect to a database called parts that has 3 feilds ie: Part number, description and price.

Please help.

Thanks.

simonm
Oct 31st, 2001, 05:40 AM
Firstly, I would suggest that this problem should have been posted in the Database Development forum.

Secondly, what database access method are you using (i.e. DAO, ADO etc.)?

Thirdly, what database are you connecting to?


Presumably, you will need to open a recordset with criteria that is taken from the first text box.

Your code might look something like this:

Set rs = New Recordset
rs.Open "SELECT Field2, Field3 FROM Table1 WHERE Field1 = '" & Text1.Text & "'"
Text2.Text = rs!Field2
Text3.Text = rs!Field3