HELP: Custom Menubar/"Action Failed" msg 
Author Message
 HELP: Custom Menubar/"Action Failed" msg

Using Access 2.0:

I have created a custom menubar for an app, which uses a number of
functions for execution by the menu choices. A curious thing: if, for
example, a menu choice is meant to Run Code:  DoThis() function, and
DoThis() contains:

[Introductory stuff]
DoCmd OpenForm "frm_Form Name"

[stuff]

If Variable=6 Then
   End
End If

[more stuff]

Then, when Variable (in truth, the result of an InputBox in which the user
has pressed "Cancel") equals six, the function ends as it ought to, but I
get a macro error box flashing on my screen: "Action Failed" referring to
the execution of the DoThis() function. Press"Halt," and all is well, but
I can't have this happening whenever the user hits "Cancel."

By the way, I attach this same function to the OnClick property of a
button on a form [=DoThis()], and it works just fine without the problem.
It's just in the context of a menu item that this function (and all like
it) exhibits this strange symptom.

Any thoughts, folks?

Thanks.
--
Paul Silverman
Oakland, CA



Sat, 06 Feb 1999 03:00:00 GMT  
 HELP: Custom Menubar/"Action Failed" msg

Why bother to trap the cancel condition, only cater for the OK.  Also make
sure that the value returned from the inputbox is the right type.  I have
used inputboxes from a custom menubar many times and I have never had any
problems.

You might also consider using an error trap of sorts to catch the error
so that the user does not see it.

If need be I could send you some sample code.

Not much but I hope it helps.

Regards
Leslie



Sun, 07 Feb 1999 03:00:00 GMT  
 HELP: Custom Menubar/"Action Failed" msg

Quote:

> Why bother to trap the cancel condition, only cater for the OK.

Simple and effective. Thanks, Leslie.
--
Paul Silverman
Oakland, CA



Sun, 07 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dbgrid "action cancelled" msg

2. msg "the operation failed"

3. GetObject("","InternetExplorer.Application") fails in Excel VBA

4. GetObject("","InternetExplorer.Application") fails in Excel VBA

5. Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report

6. the "x" on the menubar

7. The "New" button in the menubar

8. Need help, if possible: "SQLSetConnectAttr failed"

9. item.cc "The operation failed" - Help

10. HELP: "VBAJET32.DLL Failed to initialize..."

11. trap "append table" msg

12. Error msg "Invalid Field Data "

 

 
Powered by phpBB® Forum Software