Continuation Of A Long Line Of Code

lhooker

Registered User.
Local time
Today, 17:02
Joined
Dec 30, 2005
Messages
423
Below are two (2) attempts to split a MS Access VB line of code. As you see it's rather long and I need to add to it. It's for an "InputBox" statement. I tried to use a "Continuation Character (underscore) in the "First Try", it did not work. I then try to separate each line item and concatenate ("Second Try") and it fail also. Does anyone have a solution ? Thanks in advance ! ! !

First Try
mySortCheck = InputBox(" (1) Chart For Descriptions (2) Chart For Top Twenty (20) Products (3) Chart For Top Twenty (20) Salesman (4) Chart For Salesman", "Chart Type", 5) Chart For Top Twenty (20) Salesman By Region

Second Try
Line1 = "(1) Chart For Descriptions "
Line2 = "(2) Chart For Top Twenty (20) Productss "
Line3 = "(3) Chart For Top Twenty (20) Salesman "
Line4 = "(4) Chart For Salesman "
Line5 = "(5) Chart For Top Twenty (20) Errors Central Region)"
Line6 = """"
Line7 = ", "
AllLines = Line1 & Line2 & Line3 & Line4 & Line5 & Line6 & Line7

mySortCheck = InputBox(" AllLines "Chart Type", 1)
 
I will assume that this can't be done as design . . . Right ?
 
Or change this:
AllLines = Line1 & Line2 & Line3 & Line4 & Line5 & Line6 & Line7

to this

AllLines = Line1 & vbCrLf & Line2 & vbCrLf & Line3 & vbCrLf & Line4 & vbCrLf & Line5 & vbCrLf & Line6 & vbCrLf & Line7
 
Still did not work . . . The below line is in error . . .

mySortCheck = InputBox(" AllLines "Chart Type", 1)
 
Well, you don't put quotes around AllLines and you need to separate it from the title with a comma:

mySortCheck = InputBox( AllLines, "Chart Type", 1)
 
That worked . . . I over looked the quore:) . . . Thanks ! ! ! :):)
 
Here is how I handle long multi string lines...

Code:
    Dim sMessage As String

    sMessage = "Line 1" & vbCrLf
    sMessage = sMessage & "Line 2" & vbCrLf
    sMessage = sMessage & "Line 3" & vbCrLf
    sMessage = sMessage & "Line 4" & vbCrLf

    MsgBox sMessage, vbInformation, "Test"
 

Users who are viewing this thread

Back
Top Bottom