Hi,
When i click a command button to close frmcarriers i want to check if frmcontract is open, if it is open then just close frmcarriers.
If frmcontract is not open then close frmcarriers and open frmswitch. The current code i have to close frmcarriers and open frmswitch is:
I am unsure what to add to make this happen?
Thanks
When i click a command button to close frmcarriers i want to check if frmcontract is open, if it is open then just close frmcarriers.
If frmcontract is not open then close frmcarriers and open frmswitch. The current code i have to close frmcarriers and open frmswitch is:
Code:
Private Sub CmdSwitchMain_Click()
On Error GoTo Err_CmdSwitchMain_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.Close
stDocName = "frmSwitch"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CmdSwitchMain_Click:
Exit Sub
Err_CmdSwitchMain_Click:
MsgBox Err.Description
Resume Exit_CmdSwitchMain_Click
End Sub
I am unsure what to add to make this happen?
Thanks