S
shaggles
I'm working with an Access 97 db that I inherited from a
previous admin. It requires 2 forms to be updated with
the same information. I want to make form B open
automatically after form A is updated and closed. I don't
want it to open everytime someone closes form A (the form
is used for viewing information as well as entering) or
after every update to form A (there are frequently
multiple updates) so I thought something like this would
work:
Private Sub Form_Close()
On Error GoTo Err_Form_On_Close
Dim DocName As String
Dim LinkCriteria As String
DocName = "Form_B"
LinkCriteria = "[SS#] = Forms!Form_A![SS#]"
If Me.Dirty Then
DoCmd.OpenForm DocName, , , LinkCriteria
End If
Exit_Form_On_Close:
Exit Sub
Err_Form_On_Close:
MsgBox Error$
Resume Exit_Form_On_Close
End Sub
previous admin. It requires 2 forms to be updated with
the same information. I want to make form B open
automatically after form A is updated and closed. I don't
want it to open everytime someone closes form A (the form
is used for viewing information as well as entering) or
after every update to form A (there are frequently
multiple updates) so I thought something like this would
work:
Private Sub Form_Close()
On Error GoTo Err_Form_On_Close
Dim DocName As String
Dim LinkCriteria As String
DocName = "Form_B"
LinkCriteria = "[SS#] = Forms!Form_A![SS#]"
If Me.Dirty Then
DoCmd.OpenForm DocName, , , LinkCriteria
End If
Exit_Form_On_Close:
Exit Sub
Err_Form_On_Close:
MsgBox Error$
Resume Exit_Form_On_Close
End Sub