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

The DoMenuItem Action Was Canceled, How to avoid...

Status
Not open for further replies.

purkka

Instructor
Jan 17, 2003
5
FI
Hi

I have the form which handels personal information. Before new information are stored, entries of some required fields have to be checked. If I use "Cancel=true" in beforeUpdate-event, I got that stupid message (The DoMenu...). How to going around that message?
 
Hi

You use OnError GoTo to trap the error (2502 I hink from memory) and ignore it (ie Resume Next)

eg something like below:

MyCommand_Click()
On Error GoTo Error_MyCommand

DoCmd....

Exit_MyCommand:
Exit Sub
Error_MyCommand:
If err.number = 2501 Then
Resume NExt
Else
msgbox "error " & Err.Number & " " & err.description
End if
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks Ken Reay

Unfortunally your solution did not help me. I still get the same message. I have tried the following procedures:

1) Form Error-event
- Response = acDataErrContinue
- If err.number....

2)Form BeforeUpdate-event
- all done I can imaging

I check some fields with subroutine in my form's BeforeUpdate-event. If there are no data in proper fields, then msgbox and Cancel=true. It is not allowed to change or save record by then. If I code "Cancel=true" in BeforeUpdate-event, then "The DoMenuItem..."-message will appear.

There is some other messages too:
1) "The Ms Database Engine can't find a record in a table..."
2) "... because the required property for this field is set to true.."

I know exactly, what those messages mean, but I do not want to see them. I like to build my own due to my native lanquage.

I know, that unbound form can be built and save data by sql, but in my case, that is too complex.

With Rgds



 
PROBLEM SOLVED!

My form was faulty! My other forms do not show me "The DoMenu..."-message. So, let's start to built up same again.. :(

T. Purkka
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top