Consulting

Results 1 to 2 of 2

Thread: String Variable - Compile Error Expected End of Statment

  1. #1

    String Variable - Compile Error Expected End of Statment

    HI All,

    when declaring a string variable why would the following work fine:

    [vba]Sub Query_SQL3()
    Dim QSQL As String
    QSQL = "Array(""SELECT TYS____FAULT.SEVERITY,TYS____FAULT.OLD_FAULT_ID"")"
    End Sub[/vba]

    But the following produces the compile error stement:

    [vba]Sub Query_SQL3()
    Dim QSQL As String
    QSQL = "Array(""SELECT TYS____FAULT.SEVERITY, _
    TYS____FAULT.OLD_FAULT_ID"")"
    End Sub[/vba]

    Im sure its something simple but cant put my finger on it.

    thanks,

    Paddy.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try this

    [vba]

    Sub Query_SQL3()
    Dim QSQL As String
    QSQL = "Array(""SELECT TYS____FAULT.SEVERITY, " & _
    "TYS____FAULT.OLD_FAULT_ID"")"
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •