Hi
I have a Main form and a subform
The user select an employee from the list this then populates the main form with Name, Address etc.
And the subform contains anysickness.
On the main form there are input boxes for the user to enter NEW sickness details of an employee.
There is an ADD NEW button that has the following attached
Any Ideas
Thanks
I have a Main form and a subform
The user select an employee from the list this then populates the main form with Name, Address etc.
And the subform contains anysickness.
On the main form there are input boxes for the user to enter NEW sickness details of an employee.
There is an ADD NEW button that has the following attached
Code:
Private Sub AddRecord_Click()
Dim rs As Object
Dim rst As DAO.Recordset
Dim StaffNum As Double
StaffNum = Me.cmb_Search.Value
Set rst = Forms!SicknessMainForm.SicknessMainFormSub.Form.Recordset
With rst
.MoveLast
.MoveFirst
.AddNew
End With
End Sub
[code]
What I want to do is add the new sickness record into the subform but I get the following error
[code]
Runtime Error '3426'
This Action was cancelled by an associated object
Any Ideas
Thanks