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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximize Preview 1

Status
Not open for further replies.

bez999

Programmer
Oct 3, 2003
99
GB
Is it possible to show a report preview maximized automatically?
When I produce my report previews the first thing I always do is mazimize it so I can read it. I suspect this can be automated but so far I have failed to find out how.
Any help would be most appreciated.

Regards
Chris Bezant
 
Hi,
Use these codes OnOpen And Onclose events of the form
==================================
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize 'To Maximize the Report
End Sub
=================================
Private Sub Report_Close()
DoCmd.Restore 'To restore the window to the pervious size
End Sub
====================================

Regards

Zameer Abdulla

 
Thanks Zameer, that maximizes the report.
I still can't read it so is there a way to zoom in?
I looked at other DoCmd commands but didn't see anything obvious.

Thanks for your time.

Regards
Chris Bezant
 
Hi,
===========================================
Private Sub Report_Open(Cancel As Integer)
DoCmd.RunCommand acCmdZoom1000 'To Zoom the Report

DoCmd.Maximize 'To Maximize the Report

End Sub
==========================================

Change 1000 to what ever zoom size you want.

Regards

Zameer Abdulla

 
The zoom commands seem to be very hit and miss. Sometimes it obeys 1000 request and other times it doesn't. 1000 is far too big so I changed it to various other values as listed in the help and every value other than 1000 says something like size unavailable at this time.

Maybe there is some preparation step needed before the zoom?

Regards
Chris Bezant
 
Chris,

Try:
Code:
DoCmd.RunCommand acCmdFitToWindow

Hoc nomen meum verum non est.
 
Hi,
I suggested this assuming it will work with all the values. I tried this both with Macro and Code. Only 500% and 1000% is available others are giving runtime error. There are options 10% to 1000%. It is strange!!!!!
May be someone else can help us
Regards

Zameer Abdulla

 
DoCmd.RunCommand acCmdFitToWindow also gives error 2046 - The command or action 'FitToWindow' is not available now.

Private Sub Report_Open(Cancel As Integer)
DoCmd.RunCommand acCmdFitToWindow
DoCmd.Maximize
End Sub
 
The OnOpen event is too late. Are you opening the report in preview mode from a command button?? If so, add the
Code:
DoCmd.RunCommand acCmdFitToWindow
statement right after the OpenReport statement.

Hoc nomen meum verum non est.
 
CosmoKramer: Nemo hic adest illius nominis
LOL!
JSouth

---------------------------------------
The customer may not always be right, but the customer is always the customer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top