Results 1 to 2 of 2
  1. #1
    rja is offline Novice
    Windows 8 Access 2007
    Join Date
    Mar 2015
    Posts
    1

    Need to continue long list of variables on the next line


    I have a line in my VBA code with a long list of variables. My list has hit the end of the line and I am not sure how to continue on the next line. I have tried using the line break character ( _) but that does not work. Here is a sample of the line. The actual line of code has many more variables.

    ColorFP = "(""0MA114"", ""0MA115"", ""00A050"")"

    Any Ideas?

    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    If it is a string, then you can do as in this example where the long string of text is continued on 2 additional lines
    Code:
     Dim SQLInterim as string
     SQLInterim = "INSERT INTO VaUser ( EmplId, [Employee Name],  [Payment Amount],[Payment Date]," _
                     & "[Payment Number] )" _
                     & " SELECT VATrans.EmplId, VATrans.[Employee Name], VATrans.AmountofPaymentsInBetween,"
    Here is another - spread across several lines

    Code:
      Dim sqla As String
          sqla = "CREATE table tblxmlnodes" & _
           "(id counter,  nodeparent Number " & _
                "  , nodename varchar(50)" & _
                "  , nodechain varchar(250)" & _
                "  , nodelevel varchar(20)" & _
                "  , nodeorder NUMBER " & _
                "  , nodeleaf varchar(30)" & _
                " , nodeValue varchar(250));"
    For your data, I would probably put them into a table.

    Another option is to put the values in an array.
    Dim colorFPArr(2) as string
    ColorFP(0) ="0MA114"
    ColorFP(1) ="0MA115"
    ColorFP(2) ="00A050"

    If you have a long list of text values, you could put them into a table.
    Depends on what you're trying to accomplish.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Finding a long list of records
    By curios in forum Access
    Replies: 2
    Last Post: 01-29-2015, 03:03 PM
  2. I have a Save/Continue Problem!!
    By Z1nkstar in forum Access
    Replies: 2
    Last Post: 11-25-2014, 12:02 PM
  3. Replies: 5
    Last Post: 06-22-2014, 12:10 AM
  4. Save/Continue Is what I want???
    By Z1nkstar in forum Access
    Replies: 15
    Last Post: 06-20-2014, 12:52 PM
  5. Replies: 2
    Last Post: 02-04-2010, 10:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums