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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force a new line in a message using SendObject

Status
Not open for further replies.

pbrown2

Technical User
Jun 23, 2003
322
US
Currently this code is being used on a form that sends each user their password. However, I would like to force a new line in the e-mail at certain spots (just as if I was typing this in e-mail an pressed the "Enter" key to start a new line)
In the code I have placed $NEW LINE$ where a new line needs to start and $INSERT BLANK LINE$ where we would like to see a space.


If Me.Plant <> &quot;EXEC&quot; Then
DoCmd.SendObject , , , [UserID], , , &quot;Capital Budget Password&quot;, &quot;Your Password is: &quot; & [ReviewPassword] & &quot; $NEW LINE$This password will allow you to enter the Review area of the Budget. From this area you are able to add new, modify or delete items and view multiple reports. $NEW LINE$Also, if you execute any of the enginering combination reports, the password is: &quot; & [SmyrnaEngineering] & &quot;.&quot;, False
Emailsent.SetFocus
[Emailsent] = True
DoCmd.Close
Else
DoCmd.SendObject , , , [UserID], , , &quot;Capital Budget Password&quot;, &quot;Your Password is: &quot; & [ReviewPassword] & &quot; $NEW LINE$With the exception of locking the budget for review, this password will grant you access to every secured portion of the database. $INSERT BLANK LINE$To lock or unlock the database for review, use the password: &quot; & [LockDBPassword] & &quot; . To lock, click on the Nissan Logo on the entrance screen. To unlock, click on the Unlock button located on the Review screen&quot;, False

Emailsent.SetFocus
[Emailsent] = True
DoCmd.Close
End If


Any suggestions?

Thank you for any and all help,

PBrown
 
Hi PBrown!

The constant to insert a new line is vbCrLf so you would use is like this:

&quot;Some text&quot; & vbCrLf & &quot;Some more text&quot;

hth


Jeff Bridgham
bridgham@purdue.edu
 
Okay,
I have tried multiple combinations of both vbcr and vbcrlf
however I can not seem to get it working:
Below is my latest attempt but it keeps saying &quot;Expected End of Statement&quot;

DoCmd.SendObject , , , [UserID], , , &quot;Capital Budget Password&quot;, &quot;Your Password is: &quot; & [ReviewPassword] & &quot; &quot;&vbcr&&quot; This password will allow you to enter the Review area of the Budget. From this area you are able to add new, modify or delete items and view multiple reports. &quot;&vbcr&&quot; Also, if you execute any of the enginering combination reports, the password is: &quot; & [SmyrnaEngineering] & &quot;&quot;, False


Any other suggestions?

Thank you for any and all help,

PBrown
 
Hi.

Try the chr function for carriage-return Line-feed which
is

chr(10) & chr(13)

jetspin
 
Hi!

You need spaces before and after the ampersands:

DoCmd.SendObject , , , [UserID], , , &quot;Capital Budget Password&quot;, &quot;Your Password is: &quot; & [ReviewPassword] & &quot; &quot; & vbcrlf & &quot; This password will allow you to enter the Review area of the Budget. From this area you are able to add new, modify or delete items and view multiple reports. &quot; & vbcrlf & &quot; Also, if you execute any of the enginering combination reports, the password is: &quot; & [SmyrnaEngineering] & &quot;&quot;, False

Did you get any error messages?



Jeff Bridgham
bridgham@purdue.edu
 
Hi.

You also might want to change &quot;&vbcr&&quot; to &quot; & vbcr & &quot;
 
Hi.

One last thing,,, try &quot;xxxx&quot; & vbCrLf & &quot;XXXXX&quot;

Jetspin.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top