[AccessD] Control size of Report Preview window

Fred Hooper fahooper at trapo.com
Thu Aug 24 17:49:35 CDT 2006


Hi Dan,

That's a good idea; I really don't need the same level of preciseness for
previewed reports that I have for forms. I implemented it as:

Public Sub WaitForReportToClose(strReport As String)
  Dim intCount As Integer
  Dim booZoomed As Boolean

  booZoomed = IsZoomed(Reports(strReport).hWnd)
  If Not booZoomed Then DoCmd.Maximize
  While ReportIsOpen(strReport)
    intCount = intCount + 1
    If intCount Mod 1000 > 1 Then
      DoEvents
      intCount = 0
    End If
  Wend
  If Not booZoomed Then DoCmd.Restore
End Sub

Public Function ReportIsOpen(strName As String) As Boolean
  Dim intObjState As Integer
  
  intObjState = SysCmd(acSysCmdGetObjectState, acReport, strName)
  ReportIsOpen = (intObjState = acObjStateOpen)
End Function

Thank you
Fred Hooper

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Thursday, August 24, 2006 5:53 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Control size of Report Preview window

Hi Fred,

One thing you can do is to maximize every report each time it is opened in
preview:

------------------------------------------------
Private Sub Report_Close()

    DoCmd.Restore
    
End Sub
------------------------------------------------
Private Sub Report_Open(Cancel As Integer)
    
    DoCmd.Maximize
    
End Sub
------------------------------------------------

You'll need to include the Restore method because maximizing any object
maximizes all the objects.  When you restore, all objects go back to their
original size.

This also resolves the issue of trying to anticipate different monitor
settings.

HTH,
Dan Waters
ProMation Systems, Inc.

-----Original Message-----
Subject: [AccessD] Control size of Report Preview window

Is there any way to control the size of the report preview window?

Runcommand acCmdZoom (10 ... 200) controls the size of the printing in the
window but doesn't control the size of the window.

Manually sizing the window and pressing the save button "kind of" works, but
the window gets progressively smaller as the front end is repeatedly
compacted and repaired. Also, when it's moved to a machine with a lower
resolution monitor it further shrinks.

Is there something using twips (like there is for forms) that I can read,
save & apply so the report preview window will be the same inch/cm
dimensions on all monitors, regardless of their resolution?

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list