L
lynette
hi, i have a form with a subform and want to print labels
containing info from both forms. The user determines the
number of labels to be printed for each record.
Example:
Form A
TransactionNo = Primarykey Table A (autono)
TranDate
Print Label = command button
Subform B
Product = Primarykey Table B
#Labels = X no of labels to be printed for this record
*(this form works just like the Order Entry form of
Northwind database where multiple products can be entered
under one transaction no)
I am using the module below that i found in the web. The
only problem is it prints labels for all transactions.
furthermore, i cannot put a criteria in the underlying
query for other reports are also based on it. Is there a
way to just modify the module below to that it only prints
labels for the current transaction? Or should i just
create a new query for this purpose?
any suggestion on how to accomplish this task will be
greatly appreciated.
thanks for your reply...
Label Module:
Option Compare Database
Option Explicit
Dim LabelBlanks&
Dim BlankCount&
Dim CopyCount&
Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of blank
labels to skip"))
If LabelBlanks& < 0 Then LabelBlanks& = 0
End Function
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (Reports!Labels![Labels] - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function
containing info from both forms. The user determines the
number of labels to be printed for each record.
Example:
Form A
TransactionNo = Primarykey Table A (autono)
TranDate
Print Label = command button
Subform B
Product = Primarykey Table B
#Labels = X no of labels to be printed for this record
*(this form works just like the Order Entry form of
Northwind database where multiple products can be entered
under one transaction no)
I am using the module below that i found in the web. The
only problem is it prints labels for all transactions.
furthermore, i cannot put a criteria in the underlying
query for other reports are also based on it. Is there a
way to just modify the module below to that it only prints
labels for the current transaction? Or should i just
create a new query for this purpose?
any suggestion on how to accomplish this task will be
greatly appreciated.
thanks for your reply...
Label Module:
Option Compare Database
Option Explicit
Dim LabelBlanks&
Dim BlankCount&
Dim CopyCount&
Function LabelSetup()
LabelBlanks& = Val(InputBox$("Enter Number of blank
labels to skip"))
If LabelBlanks& < 0 Then LabelBlanks& = 0
End Function
Function LabelInitialize()
BlankCount& = 0
CopyCount& = 0
End Function
Function LabelLayout(R As Report)
If BlankCount& < LabelBlanks& Then
R.NextRecord = False
R.PrintSection = False
BlankCount& = BlankCount& + 1
Else
If CopyCount& < (Reports!Labels![Labels] - 1) Then
R.NextRecord = False
CopyCount& = CopyCount& + 1
Else
CopyCount& = 0
End If
End If
End Function