PDA

View Full Version : Solved: Vb New Line



PsYiOn
06-10-2008, 07:20 AM
i get a sytax Error with teh following code

txtQ.Value = "CS_WLR3_AFL_ACTIVITY_QUEUE" & vbNewLine & _
"Raise as an Activity NOT an enquiry." & vbNewLine & _
"AREA: Complaint - Compensation" & vbNewLine & _
"TYPE: Compensation" & vbNewLine & _
"DETAILS REQUIRED:" & vbNewLine & _
"telephone number the claim is for:" & vbNewLine & _
"Date reported:" & vbNewLine & _
"Date cleared:" & vbNewLine & _
"# of lines reported:" & vbNewLine & _
"Survey required Y/N" & vbNewLine & _
"DRRC/MCA paid ?" & vbNewLine & _
"Previous relevant faults/claims:" & vbNewLine & _
"Fault Location:" & vbNewLine & _
"Name and address for the claim pack." & vbNewLine & _


I am trying to add these lines to a textbox any idea why its not working. I have not used VB new line in a long time...

Edit: Backslash added to tags

lifeson
06-10-2008, 07:29 AM
Try this

Dim msg As String
msg = "CS_WLR3_AFL_ACTIVITY_QUEUE" & vbNewLine
msg = msg & "Raise as an Activity NOT an enquiry." & vbNewLine
msg = msg & "AREA: Complaint - Compensation" & vbNewLine
msg = msg & "TYPE: Compensation" & vbNewLine
msg = msg & "DETAILS REQUIRED:" 'etc

Me.TextBox1.Value = msg

remove the & _ after the vbnewline

mdmackillop
06-10-2008, 07:35 AM
The error is the continuation in your last line of code
"Name and address for the claim pack." & vbNewLine

PsYiOn
06-10-2008, 08:55 AM
lol thanks i guess i got carries away with copy and paste, works fine when i removed the last new vbline :D