module question

P

Peter Mcc

I used this from another post as a suggestion to bypass the Outlook email
warning message as a module in my database-


Set outl = CreateObject("Outlook.Application")
Set mail = outl.CreateItem(olMailItem)
mail.To = "(e-mail address removed)"
mail.Subject = ActiveWorkbook.Name
mail.attachments.Add (ActiveWorkbook.FullName)
mail.display
SendKeys "^{ENTER}"

Set outl = Nothing
Set mail = Nothing




Compile error. In query expression ‘(((Sales.[Date Of Call]) Between Date()
and (date()+1)))’.

When the module is empty the all query work fine.
Any ideas on what I did wrong.
 
P

Peter Mcc

I should note that the compile error pops up when i try to run the send mail
macro only if the module is present.
Peter Mcc said:
I used this from another post as a suggestion to bypass the Outlook email
warning message as a module in my database-


Set outl = CreateObject("Outlook.Application")
Set mail = outl.CreateItem(olMailItem)
mail.To = "(e-mail address removed)"
mail.Subject = ActiveWorkbook.Name
mail.attachments.Add (ActiveWorkbook.FullName)
mail.display
SendKeys "^{ENTER}"

Set outl = Nothing
Set mail = Nothing




Compile error. In query expression ‘(((Sales.[Date Of Call]) Between Date()
and (date()+1)))’.

When the module is empty the all query work fine.
Any ideas on what I did wrong.
 

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