return value from recordset to textbox

M

Microsoft

If I have a form that has a recordset calling info out of a table. How can
I return that data from the recordset to the txtbox in a form?

dim rst as adodb.recordset
dim conn as adodb.connection

set conn = current.project
set rst=new adodb.recordset

rst.open "customers"
do until rst.eof
rst.movenext
loop

Now I have my data. I want to display it in a text boxes on my form that I
can use the recordselector for to move to the next record displaying the
first record first. BOF
 
J

Jonathan

-----Original Message-----
If I have a form that has a recordset calling info out of a table. How can
I return that data from the recordset to the txtbox in a form?

dim rst as adodb.recordset
dim conn as adodb.connection

set conn = current.project
set rst=new adodb.recordset

rst.open "customers"
do until rst.eof
rst.movenext
loop

Now I have my data. I want to display it in a text boxes on my form that I
can use the recordselector for to move to the next record displaying the
first record first. BOF
Hi,
If you simply have the form's record source as the
customers table, you can then have the control source for
each textbox bound to any field of this table. You then
use the built-in record navigation bar. Using this
approach will save you a tonne of code.

I recommend that you examine the sample database Northwind.

Luck
Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top