Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Hyperlink code problems can not insert message text 1

Status
Not open for further replies.

hrg

Programmer
Jan 8, 2009
46
0
0
US
Hi

I have a form and it has text boxes where you enter data. There is a button at the bottom and once clicked it opens an email with the senders name and subject. The problem i am having is to put all the data enetered in to the message text of the email. I can insert a single entry but not all off the data entered. Does anybody know how?


DoCmd.SendObject acSendNoObject, , , "grix@hallmarkconsumer.co.uk", , , "Purchase request Form", name, , txtemail


The above CODE works fine but the messsage text is just a name and i need the following as well :-

Project Number
Description
quantity

I have tried the code below but it does not work.


DoCmd.SendObject acSendNoObject, , , "grix@hallmarkconsumer.co.uk", , , "Purchase request Form", name Desc Quantity, , txtemail

The above code has a problem it is all on one line but when i come to the name Desc Quantity it will not let me put it in the message part of the email. I also want to start a new line at Desc and Quantity and i do not know how?

can anyone help thanks
 
Hi, I don't remember how to force a hard return which would put them on different lines, but to get them to all come up you would need: name & " " & desc & " " & quantity

this would give you the three items with a space (" ") in between each

 
Short addition to the AccessIsFun's response..
The constant for inserting line breaks is vbCrLf. So the above code would be:
name & vbCrLf & desc & vbCrLf & quantity

Alternatively, you can replace "vbCrLf" with "chr(13) & chr(10)" (in that order), which does exactly the same thing. vbCrLf is easier to remember :) - I just need to know the latter for hard returns in reports.
 

Thank you very much for your help it has worked impressivley with flying colours. Once again thank you AccessIsFun & Katerine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top