"Phil Stanton" <ph**@stantonfamily.co.ukwrote in
news:13*************@corp.supernews.com:
Change of font had no effect.
Have partially resolved the problem though.
The original report is on A6 paper, width 105mm with left and right
margins set at 6mm. The report grid size is 10 both ways. I am using
snap to grid. The 2 fields where I am having problems left position is
77.99 ( why with snap to grid it is not 78 I have no idea) and the
width is 15.01 which all adds up OK. This is the layout of the report
that works on my main machine, but not the laptop.
If I pull the margins down to 5.7 and increase the field width to
15.52 (guess I better change the grid to 20) works OK on both
machines. Any wider margins or narrower field size won't export
correctly on my laptop. All very odd
I think this might address the problem that maybe you're identifying ...
maybe ... perhaps.
What it tries to do is set all control locations and sizes to an exact
number of pixels for your set up.
I expect I don't have to remind you to try it (if you are going to try it)
on a throw way copy, but I'll include the warning for anyone else who might
be reading this.
Of course, you'll see and have to repair extra line feeds introduced by
news clients.
Private Declare Function GetDC& Lib "user32" _
(ByVal windowHandle&)
Private Declare Function ReleaseDC& Lib "user32" _
(ByVal windowHandle&, ByVal WindowDeviceHandle&)
Private Declare Function GetDeviceCaps& Lib "gdi32" _
(ByVal windowHandle&, ByVal Index&)
Private Const LOGPIXELSX& = &H5A
Private Const LOGPIXELSY& = &H5A
Private Const TWIPSPERINCH& = 1440
Public Sub StandardizeControlDimensions(ByVal ReportName$)
Dim rpt As Report
Dim ctl As Control
Dim aTwipsPerPixel As Variant
aTwipsPerPixel = TwipsPerPixel()
On Error GoTo StandardizeControlDimensionsErr
Echo 0
DoCmd.OpenReport ReportName, acDesign
Set rpt = Reports(ReportName)
For Each ctl In rpt.Controls
ctl.Height = (Round(ctl.Height / aTwipsPerPixel(1), 0) * aTwipsPerPixel
(1))
ctl.Width = Round(ctl.Width / aTwipsPerPixel(0), 0) * aTwipsPerPixel(0)
Next ctl
StandardizeControlDimensionsExit:
Echo -1
DoCmd.Close acReport, ReportName, acSaveYes
Exit Sub
StandardizeControlDimensionsErr:
With Err
MsgBox .Description, vbCritical, "Error # " & .Number
End With
Resume StandardizeControlDimensionsExit
End Sub
Public Function TwipsPerPixel()
Dim aTwipsPerPixel$(0 To 1)
Dim DesktopWindow&
Dim DesktopWindowDeviceHandle&
DesktopWindowDeviceHandle = GetDC(DesktopWindow)
aTwipsPerPixel(0) = TWIPSPERINCH \ GetDeviceCaps
(DesktopWindowDeviceHandle, LOGPIXELSX)
aTwipsPerPixel(1) = TWIPSPERINCH \ GetDeviceCaps
(DesktopWindowDeviceHandle, LOGPIXELSY)
ReleaseDC DesktopWindow, DesktopWindowDeviceHandle
TwipsPerPixel = aTwipsPerPixel
End Function
One more time: for anyone thinking of trying this; do it on a throw away
copy of the report, please..