Results 1 to 11 of 11
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Runtime 3077 (Access 2K sp3)

    Hello all: I am getting a '3077 Syntax error in string in expression' using the code below. This is in a report and it happens about 1/3 of the way into the report, which means about 300 or so records pass through this. Any suggestions?? Thanks in advance.

    rst.FindFirst "[rptMonth] = #" _
    & RepDate & "# and [ProductName] = '" _
    & Me![ProductName] & "'"

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Have you checked the fields in the table for NULL values. Also look for any values in the referenced fields that "look" strange.
    The error is basiclly saying that something you are trying to use in the string you are building is goofy. With dates it could be
    a value that does not equate to a valid date(ex 2/30/2005 or Frank).

    Hope this helps.
    Richard

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Thanks for the reply, Richard. I could not find anything wrong with the data, I'm attaching a scaled-down version. Thanks again

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Runtime 3077 (Access 2K sp3)

    What are you trying to get with this report?

    Do you want the month in the headings or the month and year?

    Why don't you create a crosstab query for the report?

  5. #5
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Thanks for the reply Patrick:

    I'm getting the month and year in the report. This is a rolling 12 month report so that when a new month is added the oldest drops off. I don't know if I can accomplish that with a crosstab query, but I may have to try if this problem isn't solved. Thanks again.

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Why don't you specify start and end dates in a form then call the report from there, you could then use the crosstab query idea then.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Runtime 3077 (Access 2K sp3)

    On looking at your data there is a name called {Cable Sling 3/8" x 4'}, this has got both single and double quotes.

  8. #8
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Thanks again Pat. I knew it had to be the data. But I think I'll try the crosstab as you suggested. Thanks again.

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Runtime 3077 (Access 2K sp3)

    The only problem with the crosstab is the ordering of mmm/yy for the headers.

    If you want these in the correct order you will have to build the pivot clause in the query prior to running the report. I would tend to do this from a form where you could also specify your range of dates.

  10. #10
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime 3077 (Access 2K sp3)

    He Pat: Thanks for all the help. I cleaned up the data (removing all " and '); also had to use the nz function in the code to cover the situation where there was null quantities. All is well in Ohio, USA for now. Will begin the crosstab challenge over the weekend. Thanks again.

  11. #11
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Runtime 3077 (Access 2K sp3)

    Base you crosstab on the query you have now.

Posting Permissions

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