Problem with programming for 3 labels per page

L

LADOCITGUY

I have a report header (0.2"), a detail section of 4.597", and a group footer
(1"). The page margins are 0.5" top and bottom.

I have to print 3 certification cards per page - and keep the data in the
same spot on each page. The 1st sub (below) suppresses the group footer for
the 3rd label on each page. The 2nd and 3rd subs are used to skip a card if
the user wants to start the printing on the 2nd or 3rd card instead of the
1st.

My problem is when I enter any number other than 0 to skip labels, the
labels "creep up" the page. I'm thinking it is because I am using a report
header when I added the text boxes to perform the skip routine.

Any suggestions on solving this? Is there any way to have text boxes in the
header (set to not visible) but NOT use any space in printing them? This
would solve my problem, I believe - because it works fine without the text
boxes and the skip routine.


Private Sub GroupFooter3_Format(Cancel As Integer, FormatCount As Integer)
Me.GroupFooter3.Visible = (((Me.txtCount - 1) Mod 3) <> 2)
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip" Then
Me.NextRecord = False
Me.PrintSection = False
Else
[SkipControl] = "No"
Me.PrintSection = True
Me.NextRecord = True
End If
End Sub


Thanks

CH
 
G

GeoffG

I'm thinking it is because I am using a report
header when I added the text boxes to perform
the skip routine.

Could you delete the report header and use the Report_Open
event to display a message using the InputBox() function?
Capture the number of labels to be skipped and use that
value in the Detail_Format event.

For example, in the module behind the report:

Option Compare Database
Option Explicit

Private mintSkip As Integer
Private mintSkipped As Integer

Private Sub Report_Open(Cancel As Integer)
Dim strSkip As String
strSkip = InputBox("Skip how many (0-2)?", , 0)
If strSkip = "" Then
Cancel = True
Else
Select Case CInt(strSkip)
Case 0, 1, 2
mintSkip = CInt(strSkip)
Case Else
MsgBox "Invalid entry."
Cancel = True
End Select
End If
End Sub

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

If mintSkipped < mintSkip Then
Me.NextRecord = False
Me.PrintSection = False
mintSkipped = mintSkipped + 1
End If

End Sub

If this doesn't help, maybe an Access newsgroup specializing
in Reports would be better?

Geoff






message
I have a report header (0.2"), a detail section of 4.597",
and a group footer
(1"). The page margins are 0.5" top and bottom.

I have to print 3 certification cards per page - and keep
the data in the
same spot on each page. The 1st sub (below) suppresses
the group footer for
the 3rd label on each page. The 2nd and 3rd subs are used
to skip a card if
the user wants to start the printing on the 2nd or 3rd
card instead of the
1st.

My problem is when I enter any number other than 0 to skip
labels, the
labels "creep up" the page. I'm thinking it is because I
am using a report
header when I added the text boxes to perform the skip
routine.

Any suggestions on solving this? Is there any way to have
text boxes in the
header (set to not visible) but NOT use any space in
printing them? This
would solve my problem, I believe - because it works fine
without the text
boxes and the skip routine.


Private Sub GroupFooter3_Format(Cancel As Integer,
FormatCount As Integer)
Me.GroupFooter3.Visible = (((Me.txtCount - 1) Mod 3) <>
2)
End Sub

Private Sub ReportHeader_Format(Cancel As Integer,
FormatCount As Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip"
Then
Me.NextRecord = False
Me.PrintSection = False
Else
[SkipControl] = "No"
Me.PrintSection = True
Me.NextRecord = True
End If
End Sub


Thanks

CH
 
G

GeoffG

On second thoughts, perhaps better to use a Variant in case
the user enters text that can't be converted to an integer,
as follows:

Option Compare Database
Option Explicit

Private mintSkip As Integer
Private mintSkipped As Integer

Private Sub Report_Open(Cancel As Integer)
Dim vntSkip As Variant
vntSkip = InputBox("Skip how many (0-2)?", , 0)
If vntSkip = "" Then
Cancel = True
Else
If VarType(vntSkip) <> vbInteger Then
MsgBox "Invalid entry."
Cancel = True
Else
Select Case CInt(vntSkip)
Case 0, 1, 2
mintSkip = CInt(vntSkip)
Case Else
MsgBox "Invalid entry."
Cancel = True
End Select
End If
End If
End Sub

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

If mintSkipped < mintSkip Then
Me.NextRecord = False
Me.PrintSection = False
mintSkipped = mintSkipped + 1
End If

End Sub

Geoff





GeoffG said:
I'm thinking it is because I am using a report
header when I added the text boxes to perform
the skip routine.

Could you delete the report header and use the Report_Open
event to display a message using the InputBox() function?
Capture the number of labels to be skipped and use that
value in the Detail_Format event.

For example, in the module behind the report:

Option Compare Database
Option Explicit

Private mintSkip As Integer
Private mintSkipped As Integer

Private Sub Report_Open(Cancel As Integer)
Dim strSkip As String
strSkip = InputBox("Skip how many (0-2)?", , 0)
If strSkip = "" Then
Cancel = True
Else
Select Case CInt(strSkip)
Case 0, 1, 2
mintSkip = CInt(strSkip)
Case Else
MsgBox "Invalid entry."
Cancel = True
End Select
End If
End Sub

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

If mintSkipped < mintSkip Then
Me.NextRecord = False
Me.PrintSection = False
mintSkipped = mintSkipped + 1
End If

End Sub

If this doesn't help, maybe an Access newsgroup
specializing in Reports would be better?

Geoff






in message
I have a report header (0.2"), a detail section of
4.597", and a group footer
(1"). The page margins are 0.5" top and bottom.

I have to print 3 certification cards per page - and keep
the data in the
same spot on each page. The 1st sub (below) suppresses
the group footer for
the 3rd label on each page. The 2nd and 3rd subs are
used to skip a card if
the user wants to start the printing on the 2nd or 3rd
card instead of the
1st.

My problem is when I enter any number other than 0 to
skip labels, the
labels "creep up" the page. I'm thinking it is because I
am using a report
header when I added the text boxes to perform the skip
routine.

Any suggestions on solving this? Is there any way to
have text boxes in the
header (set to not visible) but NOT use any space in
printing them? This
would solve my problem, I believe - because it works fine
without the text
boxes and the skip routine.


Private Sub GroupFooter3_Format(Cancel As Integer,
FormatCount As Integer)
Me.GroupFooter3.Visible = (((Me.txtCount - 1) Mod 3)
<> 2)
End Sub

Private Sub ReportHeader_Format(Cancel As Integer,
FormatCount As Integer)
[SkipControl] = "Skip"
Cancel = True
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
If PrintCount <= [SkipCounter] And [SkipControl] = "Skip"
Then
Me.NextRecord = False
Me.PrintSection = False
Else
[SkipControl] = "No"
Me.PrintSection = True
Me.NextRecord = True
End If
End Sub


Thanks

CH
 

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

Similar Threads


Top