Results 1 to 3 of 3
  1. #1
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172

    Compile Error: Expected: list separator or )

    Hi,

    I have a script to send Reports via e-mail. There are 2 different sets of reports, which are basically using the same module, modified to reflect the correct report names etc.

    The first one is working perfectly.

    The second one includes so many reports, that they do not fit in one line of VBA, therefore I have tried to break them down using space underscore, however I am getting "Compile Error: Expected: list separator or )". Any suggestions? here is the section of code that is throwing the error:

    blnSuccessful = FnSafeSendEmail( _
    "abc@xyz.com; def@xyz.com", _
    "Statistical Reports", _
    strHTML, _
    "R:\VRS1 Report 1 - YTD.snp; _
    R:\VRS2 Report 2 - Month.snp; _
    R:\VRS3 Report 3 - YTD.snp; _
    R:\VRS4 Report 4 - Month and YTD.snp;")
    Thanks,

    Kirsti

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You need opening and closing quotes and & on every line.

    "R:\VRS1 Report 1 - YTD.snp; " & _
    "R:\VRS2 Report 2 - Month.snp; " & _


    etc

  3. #3
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Thanks! That fixed it - who knew it would be so easy?!

    Kirsti

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

Similar Threads

  1. Replies: 6
    Last Post: 11-24-2011, 08:38 PM
  2. Replies: 6
    Last Post: 09-28-2011, 09:20 PM
  3. 3061 Error. Too few parameters. Expected 1.
    By rghollenbeck in forum Queries
    Replies: 5
    Last Post: 09-28-2011, 12:12 PM
  4. Replies: 8
    Last Post: 01-19-2011, 04:48 AM
  5. compile error: expected end of statement
    By RedGoneWILD in forum Programming
    Replies: 5
    Last Post: 07-29-2010, 10:12 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