R
Rashid Khan
Hello All
I have copied the following code from the newsgroup by Mr. Bruce M. Thompson
but now my Preview Invoice button does not show anything :-(
What am I missing?
TIA
Rashid
*********************CODE START
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Error handling costs extra <g>
Dim iRowNum As Integer, iRowHeight As Single
'You need to calculate how many rows can
'be printed before the detail section
'reaches the maximum size you want
iRowNum = 5 'For example
'The detail section's height in design view
iRowHeight = 0.25 * 1440 'For example
'Visible = Page Break
'Not Visible = No Page Break
Me.PageBreak01.Visible = (Me.txtCount.Value Mod iRowNum = 0)
'On the last page, if the detail section falls short,
'you will need to 'stretch' the section to fill the
'space
Dim iRowsNeeded As Integer
iRowsNeeded = DCount("*", Me.RecordSource) - Me.txtCount.Value
If iRowsNeeded = 0 Then
Me.Detail.Height = (iRowNum - (Me.txtCount.Value Mod iRowNum)) * 1440
Else
Me.Detail.Height = iRowHeight
End If
End Sub
'*********************CODE END
I have copied the following code from the newsgroup by Mr. Bruce M. Thompson
but now my Preview Invoice button does not show anything :-(
What am I missing?
TIA
Rashid
*********************CODE START
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Error handling costs extra <g>
Dim iRowNum As Integer, iRowHeight As Single
'You need to calculate how many rows can
'be printed before the detail section
'reaches the maximum size you want
iRowNum = 5 'For example
'The detail section's height in design view
iRowHeight = 0.25 * 1440 'For example
'Visible = Page Break
'Not Visible = No Page Break
Me.PageBreak01.Visible = (Me.txtCount.Value Mod iRowNum = 0)
'On the last page, if the detail section falls short,
'you will need to 'stretch' the section to fill the
'space
Dim iRowsNeeded As Integer
iRowsNeeded = DCount("*", Me.RecordSource) - Me.txtCount.Value
If iRowsNeeded = 0 Then
Me.Detail.Height = (iRowNum - (Me.txtCount.Value Mod iRowNum)) * 1440
Else
Me.Detail.Height = iRowHeight
End If
End Sub
'*********************CODE END