Link to home
Start Free TrialLog in
Avatar of jptu
jptu

asked on

getting rid of system notices

I can't get rid of the following notice:  
"The DoMenuItem action was canceled.  You used a method of the DoCmd object to carry out an action in Visual Basic, but then clicked Cancel in a dialog box..."

I've used the setwarnings command to turn off system messages, but it doesn't get rid of this particular one.

jptu
Avatar of brewdog
brewdog

Is this on a form, I take it? What happens when you get this message? I usually get it when I send something to print and then cancel or when my code hits an error which causes Access to cancel something.

This isn't considered one of Access' system warnings -- it's an actual error (2501, I think). That means you'll have to trap it.
I've gotten this same message a couple of times when performing a TransferText on a locked text file.  The cause of the problem was a timed out FTP session which was used to transfer the text file from our mainframe.  I had to reboot to release the lock and the TransferText then worked fine.

lmerrell
jptu:

I run into this all the time when using a command button to open a form that uses a parameter query as a datasource or has a construct similar to "[Enter Customer]" in the QBE grid as criteria.  If your command button opens the form, then the query will display an input box for the parameter.  If you then click cancel, the form can't open because the query can't run without parameters.

I believe the best solution is to use a form to gather input, process the input, and then open the form only when you've got good parameters from the user.

If this isn't the case, gleefully ignore my comment and let us know the exact conditions that give you the error message.

Wes
Avatar of jptu

ASKER

I don't think it is an error message, because my procedure doesn't jump to the error messge that I specify when this error occurs.  I get this error when I switch to another form.  However, before switching, it will ask if the user wants to save the form first.  If yes, then it goes to save the form, but it must pass some validation rules first.  If it doesn't pass, then the save is cancelled and the form is not switched.

jptu
Avatar of jptu

ASKER

wesleystewart- I was thinking of doing that too.  I will wait a bit more for additional comments before taking this approach.  Thanks.

jptu
ASKER CERTIFIED SOLUTION
Avatar of BrianWren
BrianWren

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
glad you got an answer. Just curious (for me and others who might look at this later): what was the situation, and how did BrianWren's comment solve it?