Center the report!

G

Ghost Surfer

Does anyone know how to center a report (e.g. Sales Figures FOr 2004) in the
MS Access window. The behavior I am looking for is similar to the
"Auto-Center" functionality embedded in the form.
Thanks.
 
M

M.L. Sco Scofield

This again illustrates how important it is to tell up what version of Access
you are using.

There has been an AutoCenter property in reports just like there is in forms
for the last two versions (2002 and 2003) of Access.

If you don't have it, then you must be using a very old version (2000 or
earlier) version of Access.

I find it amazing that everyone begs Microsoft to add new features.
Microsoft listens and adds the new features. And then people won't upgrade.
It's truly amazing.

Time to upgrade.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
M

M.L. Sco Scofield

Like I said in my other reply, it's time to upgrade.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
D

Dirk Goldgar

Ghost Surfer said:
Does anyone know how to center a report (e.g. Sales Figures FOr 2004)
in the MS Access window. The behavior I am looking for is similar to
the "Auto-Center" functionality embedded in the form.
Thanks.

I haven't tested this thoroughly, and it wasn't really designed for this
purpose, but if you download and import Nicole Clainoiu's "clFormWindow"
class from the Access Web:

http://www.mvps.org/access/forms/frm0042.htm

.... then code like this may work to center the report preview window,
more or less:

'----- start of code -----
Sub OpenAndCenterReport(ReportName As String)

Dim fwReport As New clFormWindow
Dim fwAccess As New clFormWindow
Const conFudgefactor = 50

fwAccess.hWnd = hWndAccessApp

DoCmd.OpenReport ReportName, acViewPreview
fwReport.hWnd = Reports(ReportName).hWnd

fwReport.Left = (fwAccess.Width - fwReport.Width) / 2
fwReport.Top = ((fwAccess.Height - fwReport.Height) / 2) -
conFudgefactor

Set fwReport = Nothing
Set fwAccess = Nothing

End Sub

'----- end of code -----

It seems to work on my system, but be aware that the constant
conFudgeFactor was arrived at by trial and error, and I'm not sure
whether it might not vary depending on your screen resolution. I'm sure
there's a more precise way to do this; this was just a quickie attempt.
 
G

Ghost Surfer

I appreciate it.
I will try this out. I just inherited the old system from a previous
programmer. It is not within my discretion to decide to purchase a newer
version of the MS Office Suite. Besides, we are moving the old system to
..NET.
Again, thanks.
 
G

Ghost Surfer

Thanks Dirk. Imported the class module and did a little tweaking and it
worked excellently. Q&Aed using different screen resolutions, and on both
it seemed to work great.
 
D

Dirk Goldgar

Ghost Surfer said:
Thanks Dirk. Imported the class module and did a little tweaking and
it worked excellently. Q&Aed using different screen resolutions, and
on both it seemed to work great.

I'm glad to hear it.
 
Top