Results 1 to 13 of 13
  1. #1
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65

    Button not opening report


    I have a main screen with buttons to allow the users of the database faster navigation. Two of those buttons open reports. The two reports are essentially identical except one is an initial report and the other is the final report. The initial report button is working perfectly. The final one is not. It prompts the correct question so the query can pull the corresponding data to fill the report. Except it seems to get stuck in an infinite loop or something of that nature. I looked at the code and nothing is jumping out at me that says it is wrong.

    Any ideas?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    Code:
    Private Sub Final Click()
    On Error GoTo Final_Click_Err
    
       DoCmd.OpenReport "FinalReport", acViewPreview, "", "", acNormal
    
    Final_Click_Exit:
      Exit Sub
    
    Final_Click_Err:
      MsgBox Error$
      Resume Final_Click_Exit
    
    End Sub
    This code is also the same exact formatting for the initial report that works perfectly.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What are the Recordsources for each of your reports?
    It could be the processes involved in gathering/editing the required "final" data.(guessing)

  5. #5
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    The record sources are the same. There is one source that is different, but just checked it to make sure it was the correct one. I am running the same subreports and queries on both of them as well. Not sure if that might be causing a problem.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    If you are stuck in an infinite loop or something of that nature it should be obvious.
    Can you put some breakpoints or debug.prints in any processing steps to identify trouble area?

  7. #7
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    DoCmd.OpenReport "FinalReport", acViewPreview, "", "", acNormal ?
    the syntax is OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)
    I've never seen empty strings ("") passed as parameters, plus acNormal is not a valid window mode argument. Surprised there are no error messages.
    I'm assuming you have tested the query underlying the report (and for any sub reports as well) and they work OK.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    yes, the sub reports and queries work just fine. As I stated they are used in both of the different reports. The initial report is working just fine. That is why I am surprised the Final report is not. The only error that I am getting on the Final report as of now is that it is Report width is Larger than page width. This doesn't make any sense cause I have looked at all the possible subreports and other elements that make up the report and all fit with in the size constraints of the page size. The error doesn't go away when I change the paper size either.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Can you post a sample database? Just enough data to show the issue.
    Do a compact and repair, then make a zip --easiest way to post it.
    Remove anything confidential!!!!

  10. #10
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by Micron View Post
    ...I've never seen empty strings ("") passed as parameters...
    I have seen this done before, and if I remember correctly, it doesn't adversely affect the function...but Micron is dead on in saying that acNormal is not a valid parameter for WindowMode...it should be acWindowNormal. Before doing anything else, I'd correct this and see what happens; as strange as it seems, this could be responsible for the error message you're getting...the Access Gnomes are not known for the accuracy of there messages!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  11. #11
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    I tried your suggestion, but it didn't fix the problem. I appreciate the help. Hopefully I will figure it out or another possible solution will come about.

  12. #12
    Radtastic10 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    65
    I decided just to remake the report with its own queries so there are not any possible issues there. It appears that this is the first option I should have gone with as the report itself has been corrupted by the Access Gnomes causing the issues.

    I would just like to say thank you for all the potential solutions that you provided it was good info that I didn't have before.

  13. #13
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Never heard of a Report becoming corrupted...but no reason why the shouldn't, I suppose, as Forms, Controls on Forms and entire Databases can and do!

    Glad you got it fixed!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 7
    Last Post: 11-03-2015, 02:43 PM
  2. Replies: 21
    Last Post: 12-06-2013, 08:58 PM
  3. Opening new Tab with command button
    By JFo in forum Access
    Replies: 2
    Last Post: 09-12-2011, 01:45 AM
  4. Replies: 3
    Last Post: 07-13-2011, 02:04 PM
  5. Button not opening up associated record.
    By BenM912 in forum Forms
    Replies: 0
    Last Post: 03-15-2011, 11:28 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