On Wed, 7 Nov 2007 15:23:25 -0500, Michael Kintner wrote:
> How can I use DoCmd.OpenQuery and not have it prompt that it is performing a
> append or delete. I would like it to perform the operation without giving
> me the warnings and just do it.
>
> Example in use within Access VB:
> DoCmd.OpenQuery "qry-append-BuildMonthlyUsage"
> DoCmd.OpenReport "rpt-ShowMonthlyUsage", acViewPreview
>
> Or is there another method that I should be using?
>
> Thank you in advance for your help,
> Michael Kintner
DoCmd.SetWarnings False
DoCmd.OpenQuery "qry-append-BuildMonthlyUsage"
DoCmd.SetWarnings True
DoCmd.OpenReport "rpt-ShowMonthlyUsage", acViewPreview
An alternative method can be used without the need to set warnings.
CurrentDb.Execute "qry-append-BuildMonthlyUsage", dbFailOnError
DoCmd.OpenReport "rpt-ShowMonthlyUsage", acViewPreview
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
|