Results 1 to 3 of 3
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313

    Report Throws Random 3021 (No Current Record) in acViewNormal Mode but not in acViewPreview Mode


    I have a Report that prints about 150 Records/Pages at a time. When I run it in acViewNormal mode and send it to a printer (or pdf writer), it fails with a 3021, No Current Record, at random points... sometimes after printing 20 records, sometimes after 50 records, sometimes after 100 records... no apparent pattern. When I run it in acViewPreview mode, it always runs successfully. Even if I take the Preview and Export/Print it, it works fine.

    I had thought that maybe somehow the Report's Record Source had changed while the Report was running, so I made the Report's Record Source a static temporary table built by the Form that calls the Report... didn't help. Although the temp table is local to Access, the other data resides on SQL Server.

    I know that in the acViewNormal mode, the On Load event doesn't trigger, however, is there anything else that is different between the two modes that might cause it to act differently?

    Since the failure is at different points, it might be some kind of timing issue. Maybe when it Previews, it runs very fast (before it can fail), but when it is Printed, the delays involved with sending the data to another device allow it to fail randomly????

    FYI... I have about 100 different Reports in this system, some more complicated than this one, and this is the only one that this happens to.

    Any suggestions are appreciated.

    Thanks, Eddie

  2. #2
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313
    I just got some new information on this problem. When we ran into this Runtime Error last week, the user mentioned that she was trying to Print the report using her fairly old laptop. I think her laptop has about 4GB of memory. Another user using a much newer Desktop with more memory then ran the complete report successfully. Is it possible that when Access PRINTS a report, it uses more memory than when it PREVIEWS a report?

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I'm no M$ engineer but this is what I believe:
    preview renders all page breaks, page/section numbering, formatting, and as you noted, events that otherwise would not run
    normal sends it direct to the printer thus records have to be retrieved and divided into page/sections/groups on the fly

    I never experienced this when the typical memory was much less and the processor speeds much slower than what's common today, but keeping the reports simple as possible might also have been a factor. I would have thought that with network and processor speeds being what they are today, the issue ought to be more common due to Access not being able to keep up. The problem seems to suggest that a print job is being spooled before the report has retrieved records for a particular section/page, and given the number of variables involved, who knows which one alone, or which in combination, are the problem?

    If you are correct in that this report isn't as "complicated" as others that don't present the problem, then perhaps you could solve this with a short pause in its Open event. In case you need to do this in some other event, the best explanation of the order of events I've seen as of yet is here
    https://www.wisdomjobs.com/e-univers...nces-8369.html

    By pause, I mean a UDF that for example, adds a period of time to the Timer function and loops until that time is reached. You probably would only need 1 or 2 seconds.
    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. acViewPreview Vs acViewNormal
    By ManuelLavesa in forum Programming
    Replies: 16
    Last Post: 09-16-2015, 06:04 PM
  2. Code runs in break/debug mode but not in normal mode
    By hansendl in forum Programming
    Replies: 2
    Last Post: 10-15-2014, 07:23 AM
  3. Replies: 4
    Last Post: 11-26-2013, 10:47 AM
  4. Replies: 2
    Last Post: 09-01-2011, 10:48 PM
  5. Replies: 4
    Last Post: 01-14-2011, 10:37 AM

Tags for this Thread

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