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

populating controls when data control not used 1

Status
Not open for further replies.

nuct

Programmer
Sep 5, 2001
103
Hi,

I need to how you can bind a text box to a recordset that has been made in code e.g:

Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset

conn.Open "Driver={SQL Server};" & _
"Server=A9000;" & _
"Database=HR;" & _
"Uid=simontest;" & _
"Pwd=simontest"

rs.Open "select * from tblstaff", conn, adOpenDynamic

The only way I can think of is:

rs.MovePrevious

Text1 = rs!forename
Text2 = rs!surname

... or that kind of thing.

Is there a better way of doing it, i.e. without having to manually repopulate each control each time you move to a new record.

Cheers,

Simon.



 
Yup, perfect. Cheers for that.

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top