Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a New Record

Status
Not open for further replies.

fabby1

Technical User
Mar 9, 2004
206
GB
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

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



 
have a look at
thread702-913934
thread702-856420

Hope this helps
Hymn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top