Font gets hudge when rpt opens

G

Guest

Hello, When I click a button in my form to open my reports they are opening
in HUDGE font (like 80 font) sometimes and if I close the report and open it
a few times it opens regularly (regular size). How do I fix this?

Here is the code behind one of my buttons:

Private Sub Command32_Click()
On Error GoTo Err_Command32_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptViewContactRecord"
DoCmd.OpenReport "rptViewContactRecord", acViewPreview, , "[ID] = " &
Me.ID


Exit_Command32_Click:
Exit Sub

Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click

End Sub
 
G

Guest

Is the font huge or the entire report? It could be zooming up to something
like 400%. Check events like On Open to see if there is any code that would
cause this to happen.

You could put the following two lines of code under your Docmd.OpenReport:

DoCmd.MoveSize 1, 1, 14500, 9000
DoCmd.RunCommand acCmdZoom100

MoveSize positions the report on the screen and acCmdZoom100 sets the zoom
level. Below are some other zoom levels.

acCmdZoom10
acCmdZoom1000
acCmdZoom150
acCmdZoom200
acCmdZoom25
acCmdZoom50
acCmdZoom500
acCmdZoom75
 
G

Guest

Jerry, The only thing I have for VBA for the reports are DoCmd.Maximize so it
shows full screen. I added the two lines of code in the OnOpen event of the
report and its giving me an Run time error 2046 "The command zoom 100% isnt
avabale now. here is the code in my OnOpen event for the report. Thnaks!

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.MoveSize 1, 1, 14500, 9000
DoCmd.RunCommand acCmdZoom100
End Sub
 
G

Guest

My mistake on the code. It needs to go in a module and not the code behind
the report or form. Something like:

Sub sOpenRptViewContactRecord()
DoCmd.OpenReport "rptViewContactRecord", acViewPreview
DoCmd.MoveSize 1, 1, 14500, 9000
DoCmd.RunCommand acCmdZoom100
End Sub

Then the code behind the button would simply be:
sOpenRptViewContactRecord()
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Chad said:
Jerry, The only thing I have for VBA for the reports are DoCmd.Maximize so it
shows full screen. I added the two lines of code in the OnOpen event of the
report and its giving me an Run time error 2046 "The command zoom 100% isnt
avabale now. here is the code in my OnOpen event for the report. Thnaks!

Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.MoveSize 1, 1, 14500, 9000
DoCmd.RunCommand acCmdZoom100
End Sub
--
Newbies need extra loven.........


Chad said:
Hello, When I click a button in my form to open my reports they are opening
in HUDGE font (like 80 font) sometimes and if I close the report and open it
a few times it opens regularly (regular size). How do I fix this?

Here is the code behind one of my buttons:

Private Sub Command32_Click()
On Error GoTo Err_Command32_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptViewContactRecord"
DoCmd.OpenReport "rptViewContactRecord", acViewPreview, , "[ID] = " &
Me.ID


Exit_Command32_Click:
Exit Sub

Err_Command32_Click:
MsgBox Err.Description
Resume Exit_Command32_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top