Hi there guys,
I am still a newbie and would appreciate it very much if someone could help me with the open and close method of the recordset in the code below. I get error messages like the object is closed and all kinds of things, but I know that it has something to do with the open and close of the recordset.....please guys!
My code:
Private Sub Command1_Click()
Dim CurrDateTime As Date
Dim NewRec As ADODB.Recordset
CurrDateTime = Now()
Set NewRec = New ADODB.Recordset
With NewRec
Set .ActiveConnection = fMain.datPrimaryRS.Recordset.ActiveConnection
.AddNew
.Fields("Name"
= fMain.txtFields(0).Text
.Fields("Surname"
= fMain.txtFields(1).Text
.Fields("Test_Results"
= fTest.Label1.Caption
.Fields("Date"
= CurrDateTime
.Update
End With
Set NewRec = Nothing
End Sub
I am still a newbie and would appreciate it very much if someone could help me with the open and close method of the recordset in the code below. I get error messages like the object is closed and all kinds of things, but I know that it has something to do with the open and close of the recordset.....please guys!
My code:
Private Sub Command1_Click()
Dim CurrDateTime As Date
Dim NewRec As ADODB.Recordset
CurrDateTime = Now()
Set NewRec = New ADODB.Recordset
With NewRec
Set .ActiveConnection = fMain.datPrimaryRS.Recordset.ActiveConnection
.AddNew
.Fields("Name"
.Fields("Surname"
.Fields("Test_Results"
.Fields("Date"
.Update
End With
Set NewRec = Nothing
End Sub