DoCmd.SetWarnings False does not suppress message

  • Thread starter Thread starter Christine
  • Start date Start date
C

Christine

The OnClick event for a cmdbutton sends a report to a SNP
file. Whilst this is happening, Access displays a message
that says "Now outputting... <file name and path>. I don't
want this message to display, especially since there is a
Cancel button on it!

How can this message be suppressed? I've tried this:

DoCmd.SetWarnings False
DoCmd.OutputTo acReport, "rpt New Employee",
acFormatSNP, "Z:\HR\Admin\NewEmp.snp", False
DoCmd.RunMacro "SendMail"
DoCmd.SetWarnings True

Cheers,
Christine
 
Hi, Christine.
How can this message be suppressed?

One can't suppress this message, not even by setting Echo off to prevent
repainting the screen while the report is being exported.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Try the following code which will turn off screen updates and set the mouse
pointer to an hourglass:

Add before
Application.Echo False
DoCmd.Hourglass True

and not forgetting to add
Application.Echo True
DoCmd.Hourglass False
after
 
Thanks to Pete for the code.

Gunny, if Pete's suggestion can't actually work, what to
do? This could be disasterous for my programme! I can see
it all now... users will click "Cancel" in that little
message box, the SNP file won't be saved, automatic email
will crash, chaos and general lawlessless will prevail. :-
) Is there another way to output an Access report that
won't generate this gremlin?

Christine
 
Hi, Christine.
Is there another way to output an Access report that
won't generate this gremlin?

Unfortunately, no. However, one can reduce the chaos and lawlessness that
will ensue by converting that macro into VBA code as a procedure. Unlike a
macro, a VBA procedure can have an error handler that one can add a message
box such as: "You have just canceled the E-mail. This report has not been
sent to any recipients."

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Hi Pete. Just saw your message. I tried your suggestion, but it didn't make
any difference. The message box is really driving me (and users) crazy,
especially since, while it is displayed, half the form disappears. Unless I
or someone else can find a solution, me thinks the snapshot option will have
to go.

Christine
 
Back
Top