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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP? - Run-time error 2501

Status
Not open for further replies.

poctok

Technical User
Jun 1, 2001
15
0
0
GB
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
 
Worked it out. Being really dumb and trying to close from inside the close event. Long day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top