Connecting Tech Pros Worldwide Help | Site Map

Print Output

Brian Keanie
Guest
 
Posts: n/a
#1: Nov 13 '05
If controls on a report have the CanShrink and CanGrow properties set to
"Yes" how then can you format your print output? other than leaving it to
the smarts of access
Don't want to show my age or lack of expertise but I'm thinking back to
Basic Basic when you had to know how many lines were going to be printed on
a page etc. Surely there must be the same requirement in access on occasion.
Could someone direct me to a site or correspondence to explain this?
In case you didn't recognize the relationship this has to do with my OLE
quandry.


bruce@aristotle.net
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Print Output


"How can you format your print output" is a pretty broad question.
However, looking at the threads regarding your OLE quandary, I think
the answer to your question lies in your report's Detail Format event
as Stephen Lebans mentioned. Try adding the following code to your
report:

In the General Declarations section add the following
declarations:

Dim mlngDetailDefaultHeight As Long
Dim mlngOLEDefaultHeight As Long

Then modify your Report_Open and Detail_Format event code as follows:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If IsNull(OLEBound1) Then
OLEBound1.Height = 0
OLEBound1.Visible = False
Me.Detail.Height = 0
Else
OLEBound1.Visible = True
OLEBound1.Height = mlngOLEDefaultHeight
Me.Detail.Height = mlngDetailDefaultHeight
End If

End Sub

Private Sub Report_Open(Cancel As Integer)

' Save the default height of the OLE control and the
' detail section it is in.
mlngOLEDefaultHeight = OLEBound1.Height
mlngDetailDefaultHeight = Me.Detail.Height

End Sub

HTH,
Bruce

bruce@aristotle.net
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Print Output



bruce@aristotle.net wrote:[color=blue]
> "How can you format your print output" is a pretty broad question.
> However, looking at the threads regarding your OLE quandary, I think
> the answer to your question lies in your report's Detail Format event
> as Stephen Lebans mentioned. Try adding the following code to your
> report:
>
> In the General Declarations section add the following
> declarations:
>
> Dim mlngDetailDefaultHeight As Long
> Dim mlngOLEDefaultHeight As Long
>
> Then modify your Report_Open and Detail_Format event code as follows:
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
>
> If IsNull(OLEBound1) Then
> OLEBound1.Height = 0
> OLEBound1.Visible = False
> Me.Detail.Height = 0
> Else
> OLEBound1.Visible = True
> OLEBound1.Height = mlngOLEDefaultHeight
> Me.Detail.Height = mlngDetailDefaultHeight
> End If
>
> End Sub
>
> Private Sub Report_Open(Cancel As Integer)
>
> ' Save the default height of the OLE control and the
> ' detail section it is in.
> mlngOLEDefaultHeight = OLEBound1.Height
> mlngDetailDefaultHeight = Me.Detail.Height
>
> End Sub[/color]

I forgot to mention that this assumes your OLE control is named
'OLEBound1'. If it's named differently, replace appropriately. Also,
you can probably get away with declaring your height storage variables
as integer rather than long, e.g.

Dim mintDetailDefaultHeight As Integer
Dim mintOLEDefaultHeight As Integer

HTH,
Bruce

Closed Thread