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 = "[email protected]"
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 = "[email protected]"
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.
 
Top