SetWarning in macro

A

AB1

I set my SetWarnings to Yes for an import and append Macro. The dialog box
pops up and works correctly. If I chose no. the macro will not fuction.
However my MsgBox still appears with the message that I input for when the
macro works. How can I keep that msgbox from showing up if I select no when
my SetWarnings dialog box answer is no?
 
A

Allen Browne

If this is Access 2007, you need to trust the location where your database
resides. To trust your folder, click:
* Office Button (top left)
* Access Options (bottom of dialog)
* Trust Center (left)
* Trust Center Settings (button)
* Trusted Locations (left)
* Add new location (button)

You may also like to consider this approach:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
 
M

Marco Pagliero

I set my SetWarnings to Yes for an import and append Macro.  The dialogbox
pops up and works correctly.  If I chose no.  the macro will not fuction.  
However my MsgBox still appears with the message that I input for when the
macro works.  How can I keep that msgbox from showing up if I select nowhen
my SetWarnings dialog box answer is no?
If I understand the point, the problem is that the macro doesn't know
that the user got a dialog box and even less that he choses no. The
same if an error occurs during the query. As far as I know there is no
way to tell the macro to stop in this case.

But if you know a condition which is false after the query succeeded
and true if the query was stopped, you can put in the next macro line
the condition and "stop macro".

Apart from that you must write a VBA routine which does all what the
macro does, because in VBA you can catch these events.

Greetings
Marco P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top