Hi,
I searched in this forum, why the report in preview mode not zoom more?
I find some code, but I don't know how to use these code and where I have to put in?
I think the best one is this:
'*********** Code Start ************
' This code was originally written by Radu Lascae
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Radu Lascae
'
Function PreviewAndZoomReport(ReportName As String, ZoomCoeff As Integer)
'function written by Radu Lascae <R.Lascae@ind.tno.nl>,
'use it at will standard disclaimer applies
'
'Instead of using DoCmd.RunCommand acCmdZoom150, or another built-in
'constant, you may use the ZoomControl property of the Report object.
'Use with care! The property is not documented anywhere.
'I have found it in a code snippet from a VB5 book.
'
'ZoomControl is a Variant that accepts virtually everything
'that can be converted to a number, positive, negative, small or large.
'The property behaves nicely if "normal" numbers are passed.
'This function allows an integer from 0 = ZoomToFit to 2500(%).
'If the value is out of range, the function uses ZoomToFit.
'The highest readable zoom I could achieve is about 2900(%) (!!!), this
'depends on the minimum scrollbar increment.
'
'The property is available for any open report that has the focus,
'irrespective if the toolbar is visible or not.
On Error GoTo Error_Handler
If Not (ZoomCoeff >= 0 And ZoomCoeff <= 2500) Then
ZoomCoeff = 0
End If
With DoCmd
.OpenReport ReportName, View:=acViewPreview
.Maximize
End With
Reports(ReportName).ZoomControl = ZoomCoeff
Exit Function
Error_Handler:
MsgBox Err.Description
Resume Next
End Function
'*********** Code End ************
thanks
Ali
I searched in this forum, why the report in preview mode not zoom more?
I find some code, but I don't know how to use these code and where I have to put in?
I think the best one is this:
'*********** Code Start ************
' This code was originally written by Radu Lascae
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Radu Lascae
'
Function PreviewAndZoomReport(ReportName As String, ZoomCoeff As Integer)
'function written by Radu Lascae <R.Lascae@ind.tno.nl>,
'use it at will standard disclaimer applies
'
'Instead of using DoCmd.RunCommand acCmdZoom150, or another built-in
'constant, you may use the ZoomControl property of the Report object.
'Use with care! The property is not documented anywhere.
'I have found it in a code snippet from a VB5 book.
'
'ZoomControl is a Variant that accepts virtually everything
'that can be converted to a number, positive, negative, small or large.
'The property behaves nicely if "normal" numbers are passed.
'This function allows an integer from 0 = ZoomToFit to 2500(%).
'If the value is out of range, the function uses ZoomToFit.
'The highest readable zoom I could achieve is about 2900(%) (!!!), this
'depends on the minimum scrollbar increment.
'
'The property is available for any open report that has the focus,
'irrespective if the toolbar is visible or not.
On Error GoTo Error_Handler
If Not (ZoomCoeff >= 0 And ZoomCoeff <= 2500) Then
ZoomCoeff = 0
End If
With DoCmd
.OpenReport ReportName, View:=acViewPreview
.Maximize
End With
Reports(ReportName).ZoomControl = ZoomCoeff
Exit Function
Error_Handler:
MsgBox Err.Description
Resume Next
End Function
'*********** Code End ************
thanks
Ali