Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zoom rpeort to "Fit"

Status
Not open for further replies.

vmon

IS-IT--Management
Feb 14, 2002
74
US
Is there a way to programatically zoom a report to "Fit". I have tried the DoCmd.RunCommand acCmdZoom75 etc. and cannot find a way to "Fit" report so that when it is displayed Maximized the page up page down work without clicking on rpeort to "Fit".

Thanks,
vmon
 
i have a button on a form which in the OnClick event it opens a report in PrintPreview
the next line is:

docmd.RunCommand acCmdFitToWindow

g
 
Hi,

I tried this as well but then i put it in the on open event:

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.RunCommand acCmdFitToWindow
End Sub

Unfortunately i get error 2046, claiming acCmdFitToWindow is not available at this moment.

Any idea's ? "In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
 
How about this:
Code:
DoCmd.OpenReport "rptReport", acViewPreview
DoCmd.Maximize
 
This works like a charm for me. I am using A2K. Might be a problem using a sub report though. I have not tried that.

vmon

Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click
Dim stDocName As String

stDocName = "rptOperatorPerformanceRanked"

DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdFitToWindow

Exit_cmdReport_Click:
Exit Sub

Err_cmdReport_Click:
MsgBox Err.Description
Resume Exit_cmdReport_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top