Get rid of warning when using DoCmd.SendObject acSendNoObject

Get rid of warning when using DoCmd.SendObject acSendNoObject
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
If the warning you refer to is generated by MS-Access, then...

Call DoCmd.SetWarnings(WarningsOn:=False) ' or, DoCmd.SetWarnings False

        DoCmd.SendObject acSendNoObject

Call DoCmd.SetWarnings(WarningsOn:=True) ' or, DoCmd.SetWarnings True

However, I suspect you may have meant a warning generated by your e-mail client (MS-Outlook, for instance).

Is that the case?
deer777Author Commented:
I tried set warnings false but that does not get rid of the prompt to allow or deny sending the email
Even tried DoCmd.SendObject acSendNoObject, , , False, False
That did not deter the allow or deny warning either
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As fanpages mentioned, if the alert is coming from your email client you'll have to take other measures.

Some have reported success with ClickYes: I've never tried it, so cannot give you any firsthand reviews.

If you want real control over your Access email I'd recommend vbMAPI: It is the easiest way to work with Outlook, and is very easy to deploy (no external references to deploy, everything is contained in a handful of class modules).
Jeffrey CoachmanMIS LiasonCommented:
Just throwing this out there...
...just for curiosity sake
...a bit heavy-handed, ...but you could create the email with outlook specific code.
(and add a reference to the Outlook Library in VbA)
...not sure if this works in the most recent versions of Access though...

roughly like this fairly popular code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

        With objOutlookMsg
            Set objOutlookRecip = .Recipients.Add("")
            objOutlookRecip.Type = olTo
            .Subject = "Your Subject"
            .Body = "Your Body text"
        End With
    End If

Set objOutlookMsg = Nothing
Set objOutlook = Nothing

Open in new window

The full code can be found here (with more options)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.