Results 1 to 7 of 7
  1. #1
    Join Date
    May 2007
    Posts
    3

    Unanswered: How to avoid the syntax error

    Hi all,

    I used this code:

    FileOut = FixName("EMPerformance-" & Format((Forms)!(Main)!(FromDate.Value), "mmddyy") & "-" & Format(Forms!Main!ToDate.Value, "mmddyy") & ".xls")

    i got error like Compile error: Expected: list seperator or )

    where should i put the brackets exactly?

    Anyone can you please help me. It would be very useful to me.

    Thanks,
    Bhaskar.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what is the error message telling you?
    ...looking at it the compiler is whinging because
    either
    its expecting a list separator (usually a comma ,)
    or
    you have a bracket ( or ) missing or misplaced
    or
    you have an unmatched quote ' or speech " mark

    did you scan the snippet of code to see if the error message was appropriate?

    do you think you have typed valid syntactically code?
    are there any missing parameters in a function call that should be separated by a comma or list separator?
    are there any unmatched or mismatched speech or quote marks?
    are all opening brackets matched by a closing bracket in the appropriate place?
    are all closing brackets matched by a opening bracket in the appropriate place?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    There look like way too many brackets here:
    Code:
    Format((Forms)!(Main)!(FromDate.Value),
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by pootle flump
    There look like way too many brackets here:
    Code:
    Format((Forms)!(Main)!(FromDate.Value),
    that was my view too.. I'd just thought bhaskara123 would get more out of the process by attempting to work out what the error message was trying to tell him, rather than run here to get an answer some 2..3 hours after he first hit the problem.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Wrists slapped... suitably chastened
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    May 2007
    Posts
    3

    I got one error

    Hi All,

    I got one error i.e Run-time error '3126':
    Invalid bracketing of name '[Forms!Main!FromDate]'.

    Code:

    FileOut = FixName("EMPerformance-" & Format(Forms!Main!FromDate.Value, "mmddyy") & "-" & Format(Forms!Main!ToDate.Value, "mmddyy") & ".xls")
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "EMPerformance", TempLoc & FileOut, True, "Summary"

    Anyone can help me. It would be very useful to me.

    Thanks,
    Bhaskar.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    did you try any of the suggestions in: http://www.dbforums.com/showthread.php?t=1617784
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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