ADIGA88
Member
- Local time
- Today, 14:57
- Joined
- Apr 5, 2020
- Messages
- 93
Hi guys,
I am trying to create an in-memory ADO recordset and bind it to a form, while I am able to create and bind the recordset to the form, the textbox will not bind with the recordset field.
Is this possible at all or I am doing something wrong?
Thanks
I am trying to create an in-memory ADO recordset and bind it to a form, while I am able to create and bind the recordset to the form, the textbox will not bind with the recordset field.
Is this possible at all or I am doing something wrong?
Code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim myForm As Form_Form1
Sub RunMe()
Set cn = New ADODB.Connection
cn.ConnectionString = CurrentProject.Connection
cn.CursorLocation = adUseClient
cn.Open
Set rs = New ADODB.Recordset
rs.Fields.Append "Name", adChar, 20
rs.Open
rs.AddNew
rs.Fields(0) = "Entry 1"
rs.Update
rs.AddNew
rs.Fields(0) = "Entry 2"
rs.Update
Set myForm = New Form_Form1
myForm.Visible = True
Set myForm.Recordset = rs
End Sub
Thanks