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

Error: DoMenuItem action was cancelled...

Status
Not open for further replies.

breaker11

Technical User
Jul 12, 2001
28
US
Hi All,
I have a recurring error message that states "The DoMenuItem action was cancelled..." after I exit a new record. I am trying to save the record to a list, but can't without this error. Any suggestions as to a resolution are appreciated, here is the code I currently have for the exit command button:


Private Sub cmdExitNew_Click()
On Error GoTo Err_cmdExitNew_Click

Dim NewOwner As String

NewOwner = Forms!frmLogin!Login
MsgBox NewOwner
Me!TypeOwner = NewOwner

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.Close

Exit_cmdExitNew_Click:
Exit Sub

Err_cmdExitNew_Click:
MsgBox Err.Description
Resume Exit_cmdExitNew_Click

End Sub

Thanks again.
 
Hi!

Apparently you canceled DoMenuItem action. BreakPoint command string

Err_cmdExitNew_Click:
MsgBox Err.Description

After programm will stop ask for error number on Immediate window:
?err.number
.XXXX
Include following in your codes:
Err_cmdExitNew_Click:
if err.number=XXXX then
resume Exit_cmdExitNew_Click
else

MsgBox Err.Description
end if

Aivars

 
Aivars,
What does the "err.number = XXXX" do? What goes in the XXXX portion of the code? Thanks.
 
It's error number.

Example:
?err.number 'Press <Enter>
2051

Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top