M
Mary
I'm using the code below to update the "s_log" table. I need to use similar
code in the same after update event to update the "c_log" table. The macro
for the c_log table update is "addtickets". The linking fields are the same,
EventID = ID.
Can you help with the code to do both updates in the same event? I think I
need to change the name of the macro and the second recordset to something
like "rst1" and insert the code in the middle of the If statement, but don't
want to mess it up. Thanks in advance for the help!
Private Sub Event_Name_AfterUpdate()
DoCmd.SetWarnings False
DoCmd.RunMacro "addsystems"
DoCmd.Requery "S_log"
Dim rst As DAO.Recordset
If Me.S_log.Form.Dirty Then
Me.S_log.Form.Dirty = False
End If
Set rst = Me.S_log.Form.RecordsetClone
If rst.RecordCount > 0 Then
With rst
..MoveFirst
Do Until .EOF
..Edit
!EventID = Me.ID
..Update
..MoveNext
Loop
End With
End If
Set rst = Nothing
DoCmd.SetWarnings True
End Sub
Thank you,
Mary
code in the same after update event to update the "c_log" table. The macro
for the c_log table update is "addtickets". The linking fields are the same,
EventID = ID.
Can you help with the code to do both updates in the same event? I think I
need to change the name of the macro and the second recordset to something
like "rst1" and insert the code in the middle of the If statement, but don't
want to mess it up. Thanks in advance for the help!
Private Sub Event_Name_AfterUpdate()
DoCmd.SetWarnings False
DoCmd.RunMacro "addsystems"
DoCmd.Requery "S_log"
Dim rst As DAO.Recordset
If Me.S_log.Form.Dirty Then
Me.S_log.Form.Dirty = False
End If
Set rst = Me.S_log.Form.RecordsetClone
If rst.RecordCount > 0 Then
With rst
..MoveFirst
Do Until .EOF
..Edit
!EventID = Me.ID
..Update
..MoveNext
Loop
End With
End If
Set rst = Nothing
DoCmd.SetWarnings True
End Sub
Thank you,
Mary