I have some code that runs when a user click the close button at the top of the form:
Private Sub Form_Close()
If IsLoaded("frmContactdetails"
Then
DoCmd.Close acForm, "frmSelectfromINvoiceListing"
DoCmd.OpenForm "frmContactDetails"
LastScreen = 1
Exit Sub
Else
If IsLoaded("frmCompanySummary"
Then
DoCmd.Close acForm, "frmSelectfromINvoiceListing", acSaveNo
DoCmd.OpenForm "frmCompanySummary"
LastScreen = 1
Exit Sub
End If
End If
DoCmd.OpenForm "Switchboard"
DoCmd.Close acForm, "frmSelectfromINvoiceListing"
End Sub
Everytime this runs it debugs and I get the error 2501: The Close Action was cancelled.
I can't see what is cancelling the Close command. Any help would be greatly appreciated.
Regards,
Nicky
Private Sub Form_Close()
If IsLoaded("frmContactdetails"
DoCmd.Close acForm, "frmSelectfromINvoiceListing"
DoCmd.OpenForm "frmContactDetails"
LastScreen = 1
Exit Sub
Else
If IsLoaded("frmCompanySummary"
DoCmd.Close acForm, "frmSelectfromINvoiceListing", acSaveNo
DoCmd.OpenForm "frmCompanySummary"
LastScreen = 1
Exit Sub
End If
End If
DoCmd.OpenForm "Switchboard"
DoCmd.Close acForm, "frmSelectfromINvoiceListing"
End Sub
Everytime this runs it debugs and I get the error 2501: The Close Action was cancelled.
I can't see what is cancelling the Close command. Any help would be greatly appreciated.
Regards,
Nicky