Lightwave
Ad astra
- Local time
- Today, 22:50
- Joined
- Sep 27, 2004
- Messages
- 1,517
Right - CRM database I have code that takes information from a text box and puts the first line in the subject line of an e-mail.
It then takes the whole field and puts that into the message body of an e-mail but unfortunately this includes the first line
For example
If I type the following into my memo field
Dear John,
Thanks for the note talk to you tomorrow
And the user hits the e-mail button I get
Subject : Dear John,
Message
Dear John,
Thanks for the note talk to you tomorrow
While I would like
Subject : Dear John,
Message
Thanks for the note talk to you tomorrow
Anyone got any ideas how I could automatically parse the memo field in a string variable so that I get everything in a memo field after the first return my code is listed at the bottom of this post. I'm using the split function at the moment to get everything before a return. I think I need to make a loop and loop through all the lines after 0 and build up a string from there…
Any pointers would be appreciated…
It then takes the whole field and puts that into the message body of an e-mail but unfortunately this includes the first line
For example
If I type the following into my memo field
Dear John,
Thanks for the note talk to you tomorrow
And the user hits the e-mail button I get
Subject : Dear John,
Message
Dear John,
Thanks for the note talk to you tomorrow
While I would like
Subject : Dear John,
Message
Thanks for the note talk to you tomorrow
Anyone got any ideas how I could automatically parse the memo field in a string variable so that I get everything in a memo field after the first return my code is listed at the bottom of this post. I'm using the split function at the moment to get everything before a return. I think I need to make a loop and loop through all the lines after 0 and build up a string from there…
Any pointers would be appreciated…
Code:
[Private Sub Command83_Click()
On Error GoTo Err_Command83_Click
Dim strMessage As String
Dim strSendTo As String
Dim Position As Integer
Dim Tstr As String
Tstr = Me.Details
strSendTo = Me.Combo86.Column(2)
strMessage = Me.Details
Position = 0
DoCmd.SendObject , , , strSendTo, , , (Split(Tstr, vbCrLf)(Position)), strMessage, True
Exit_Command83_Click:
Exit Sub
Err_Command83_Click:
'MsgBox Err.Description
Resume Exit_Command83_Click
End Sub