Results 1 to 7 of 7
  1. #1
    Admiral_Gandalf is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4

    Runtime Reports Missing Records that didn't fit in original screen size!

    I'm generating an Microsoft Access report. The report calls a form with drop down boxes and etc. which customizes a query, then feeds the resulting records to the report. Everything works great, UNLESS I open in a runtime environment.
    In runtime, the report only contains as many records as will fit in the window size that was open when the report was called (1 screen worth of records). No more records exist in the report. How do I make this work in runtime (using VBA)? It works perfectly if I'm not in the runtime environment. I need the report to not truncate, or to automatically resize to fit all the data returned by the query.
    Note: If I manually resize the window smaller in runtime, the scroll bars appear and work--but the report still only has the number of records that fit in the original window.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Conventional approach is to open form, input filter criteria on form, then open report. Are you opening report in Report view instead of Print Preview?

    What do you mean by 'runtime' - using the Access Runtime interface? I've never used it.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Admiral_Gandalf is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4
    I'm opening in report view; yes, I'm trying to open using the runtime interface so I can distribute to people without the full version of Access. The report is calling the form, then hiding it once the data is input.

    Code:
     
    Option Compare Database
    Option Explicit
    
    
    Private Sub Report_Close()
        DoCmd.Close acForm, "Cv Search"
    End Sub
    
    
    Private Sub Report_Open(Cancel As Integer)
    ' Set public variable to true to indicate that the report
    ' is in the Open event
      bInReportOpenEvent = True
    
    
    ' Open Cv Search Dialog
      DoCmd.OpenForm "Cv Search", , , , , acDialog
    
    
    ' Cancel Report if User Clicked the Cancel Button
      If IsLoaded("Cv Search") = False Then Cancel = True
    
    
    ' Set public variable to false to indicate that the
    ' Open event is completed
      bInReportOpenEvent = False
    
    
    End Sub
    The support module:

    Code:
    Option Compare Database
    Option Explicit
    Public bInReportOpenEvent As Boolean ' Is report in the Open event?
    
    
    Function IsLoaded(ByVal strFormName As String) As Boolean
    ' Returns True if the specified form is open in Form view or
    ' Datasheet view.
      Dim oAccessObject As AccessObject
      Set oAccessObject = CurrentProject.AllForms(strFormName)
      If oAccessObject.IsLoaded Then
        If oAccessObject.CurrentView <> acCurViewDesign Then
          IsLoaded = True
        End If
      End If
    End Function
    And the form code:

    Code:
    Option Compare Database
    Option Explicit
    
    
    Private Sub Command14_Click()
      Me.Visible = False
    End Sub
    
    
    Private Sub Command15_Click()
    DoCmd.Close 'Close Form
    End Sub
    
    
    Private Sub Form_Open(Cancel As Integer)
    If Not bInReportOpenEvent Then
        ' If we're not called from the report
        MsgBox "For use from the Cv Report only", _
                vbOKOnly
        Cancel = True
      End If
    Form_Open_Exit:
      Exit Sub
    End Sub

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    I don't see any code in the form that requeries/refreshes the report. So how does this work in full Access?

    Quite possibly this cannot be made to work in runtime. The report might have to be closed and reopened.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Admiral_Gandalf is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4
    After playing around with it a bit, it looks as if all the data is there--I just can't scroll down to see it. The question then becomes: how do I force scroll bars on a report in a way that they persist in the runtime version?

    Edit: The data exists to the point that 1 screen would show. I can't access, scroll, tab, or see anything past that point.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,957
    Sorry, no experience with runtime. My comment in post 4 might still be valid.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Admiral_Gandalf is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    4
    Quote Originally Posted by June7 View Post
    Sorry, no experience with runtime. My comment in post 4 might still be valid.
    Indeed. I went and simplified the code to Autoexec the form first, and have the form load the report; it works much better. Thanks.

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

Similar Threads

  1. match custom page size to screen resolution?
    By merlin777 in forum Access
    Replies: 6
    Last Post: 11-03-2014, 02:03 PM
  2. Replies: 1
    Last Post: 10-25-2014, 08:03 PM
  3. open a form based on screen size
    By sdel_nevo in forum Forms
    Replies: 2
    Last Post: 03-13-2014, 03:41 PM
  4. Screen Size
    By maintt in forum Access
    Replies: 4
    Last Post: 08-02-2010, 01:12 PM
  5. Adjusting Form size based on screen resolution
    By stombiztalker in forum Forms
    Replies: 0
    Last Post: 02-17-2009, 07:18 PM

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