Hi, I am trying to set up a button on a form that when clicked will send an email from outlook, can anyone tell me why I am getting a syntax error on this code?
DoCmd.SendObject acSendNoObject,,,(emailaddress),,,(subject),(text)
Thanks
Hi, I am trying to set up a button on a form that when clicked will send an email from outlook, can anyone tell me why I am getting a syntax error on this code?
DoCmd.SendObject acSendNoObject,,,(emailaddress),,,(subject),(text)
Thanks
Do you deliberately have () round the information?
This works fine on my machine
DoCmd.SendObject acSendNoObject, , , "realemailaddress", , , "Test", "Hi all", False
Hi Andy, that works brilliantly! Yes I tried it with or without brackets but not quote marks! am quite new to Access VBA and SQL so just learning every day and getting used to all the syntax and its idiosyncrasies. I assume the FALSE st the end is the edit properties? I have set this to true as I need the users to enter information into the email and it works.
I love these forums they help so much!
thanks for your help :
Happy to help
Basically if you want to send something like the word subject, then you use "subject". If you have previously defined subject as a variable with something like:
dim subject as string
subject = "urgent - please ignore"
then you should use subject (without the quotes)