Hi
Maybe I need to explain fully.
I have a SQLServer Database that I link to through linked tables in Access. this works fine.
I can see my tables an update them directly via datasheet if needed.
I have a form that contains the Main form and a Subform.
The main form is based on a simple query showing just name and staffno.
The subform shows all sickness relating to the employee.
The subform is linked via the staffno.
All this works OK.
I have on the main form a series on input boxes that the user enters sickness details into.
There is a ADD RECORD button.
What I want to do and can't is add the details from the input boxes into the subform.
How can I do this.
Here is the code so far on the ADD RECORD button
Hope you can help
Thanks
Phil
Maybe I need to explain fully.
I have a SQLServer Database that I link to through linked tables in Access. this works fine.
I can see my tables an update them directly via datasheet if needed.
I have a form that contains the Main form and a Subform.
The main form is based on a simple query showing just name and staffno.
The subform shows all sickness relating to the employee.
The subform is linked via the staffno.
All this works OK.
I have on the main form a series on input boxes that the user enters sickness details into.
There is a ADD RECORD button.
What I want to do and can't is add the details from the input boxes into the subform.
How can I do this.
Here is the code so far on the ADD RECORD button
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 = Me!SicknessMainFormSub.Form.Recordset
With rst
.AddNew
' ...
' ...
' ...
End With
End Sub
Hope you can help
Thanks
Phil