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

.body ""Too Many Lines Continuation" Error" 2

Status
Not open for further replies.

cthai

Technical User
Apr 19, 2011
53
US
Hello -

i'm working access 2007 and creating an email with 4 attachement but i am getting an error message "Too Many Lines Continuation" the body of the email is pretty long and there are a few breaks in there... is there away i can get around this?
Code:
.Body = "Dear " & vName & "," & vbCrLf & vbCrLf & _
                "This message is to inform you that you have been found eligible to receive a <System Insert>." & _
vbCrLf & vbCrLf & _

.......... more vbCrLf & vbCrLf & _

 
Code:
.Body = "Dear " & vName & "," & vbCrLf & vbCrLf
.Body = .Body & "This message is to inform you that you have been found eligible to receive a <System Insert>."
.Body = .Body & vbCrLf & vbCrLf

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Stop to get breathe after a few _s (I think the limit is 24 before you get the error) and go on.

.Body = "Dear " & vName & "," & vbCrLf & vbCrLf & _
"This message is to inform you that you have been found eligible to receive a <System Insert>." & _
vbCrLf & vbCrLf

.Body = .Body & "blah de blah" & _
....
 
Or ask in an Access forum.

One answer in actual VB would be to create a template custom resource with the bulk of the text and inline place holders like $1$ through $n$ and use Replace$() on the retrieved resource to insert variable values.
 
thanks ALL! i did not know that there was a limit to breaks... but now that i know.. i think i might need to stay away from it...

 
When dealing with strings, there is a performance benefit to the line continuation. So... don't avoid it completely. In fact, don't avoid it at all unless you get the "too many line continuation" error.

Truth is, you're not likely to run in to many situations where the difference in performance is noticeable. However, I encourage you to not generalize any sort of rules like "like continuation is bad".


-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top