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.
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.