J
John
I'm trying to use DAO to pre-create records on a form to an empty updateable
recordset. Later the user will fill in one value field in each record.
(My KeyField uses a defaultvalue of =NZ(DMax("[DefectID]","tblDefects"),0)+1
to generate a key value)
Private Sub cmdSetup_Click()
Dim Rst As DAO.Recordset
Set Rst = Form.RecordsetClone
Rst.AddNew
Rst.Edit
Rst("LengthM") = 100
Rst.Update
End Sub
I've tried, .MoveFirst, .AddNew, but they generate an "No Current Record"
error.
How can I get to that first new record to Edit and Update with my values?
Thanks,
John
recordset. Later the user will fill in one value field in each record.
(My KeyField uses a defaultvalue of =NZ(DMax("[DefectID]","tblDefects"),0)+1
to generate a key value)
Private Sub cmdSetup_Click()
Dim Rst As DAO.Recordset
Set Rst = Form.RecordsetClone
Rst.AddNew
Rst.Edit
Rst("LengthM") = 100
Rst.Update
End Sub
I've tried, .MoveFirst, .AddNew, but they generate an "No Current Record"
error.
How can I get to that first new record to Edit and Update with my values?
Thanks,
John