Results 1 to 4 of 4
  1. #1
    samsquared is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    May 2021
    Location
    St. Augustine, FL
    Posts
    20

    MsgBox syntax error eludes me

    I have looked at this for 30 minutes and don't know what's wrong with this statement:



    Code:
     intResponse = MsgBox("Call Finnhub bool values" & vbCrLf & vbCrLf _
        & "boolCallFinnhub:  " & boolCallFinnhub & vbCrLf _
        & "boolCallFinnhub2: " & boolCallFinnhub2 & vbCrLf _
        & "boolCallFinnhub3: " & boolCallFinnhub3) & vbCrLf _
        & "Yes: " & Chr$(9) & "Continue" & vbCrLf _
        & "No: " & Chr$(9) & "Stop the program" , vbYesNo, "Continue or cancel?")
    If the cursor is inside the statement and I move out I get "compile error. expected end of statement" with the comma before the vbYesNo highlighted. If I compile I get a generic syntax error.

    This version without lines 2-4 works fine:

    Code:
    intResponse = MsgBox("Call Finnhub bool values" & vbCrLf & vbCrLf _
        & "Yes: " & Chr$(9) & "Continue" & vbCrLf _
        & "No: " & Chr$(9) & "Stop the program", vbYesNo, "Continue or cancel?")
    I know this is something simple but I just don't see it.

    Thanks.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    you terminated it with this closing paren

    boolCallFinnhub3) & vbCrLf _
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    samsquared is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    May 2021
    Location
    St. Augustine, FL
    Posts
    20
    That was it. Thank you for the quick reply. I knew it had to be something simple.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Glad to help. If you mark this as solved (Thread Tools near the top of the page), people won't pick it from the threads list expecting to help.
    Thanks.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 15
    Last Post: 03-01-2021, 12:07 PM
  2. Msgbox Parent![fieldname] produces error even though...
    By MatthewGrace in forum Programming
    Replies: 9
    Last Post: 11-15-2020, 11:17 AM
  3. MsgBox for Error Handling
    By derek7467 in forum Programming
    Replies: 7
    Last Post: 02-13-2014, 07:13 PM
  4. Replies: 2
    Last Post: 03-14-2011, 03:42 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 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