Hi Everyone...
I have an access report that is launched from a form via vba and the NUMBER pages that are "auto printed" are based on a variable (labelsx) created by running a Mod function on the number of records in the report source. (THE PURPOSE IS TO MINIMIZE WASTE OF LABEL STOCK).
i.e.
Dim stDocName As String
On Error GoTo Err_Print_File_Labels_Click
If labelsx < 30 Then
MsgBox ("Not enough for a full sheet of Avery 8366 Labels, please try again later.")
Exit Sub
Else
End If
PAGE_COUNT = Int(labelsx / 30)
DoCmd.SelectObject acReport, "Labels Project_File_Labels_Avery_8366", True
DoCmd.PrintOut acPages, 1, PAGE_COUNT
'------------
After the printout... a seperate non vba macro runs an append query based on the source data of the report, to keep a log of the labels printed.
The problem is the append query is logging all records from the report source...How do I tell the append query to write only the number of records equal to PAGE_COUNT * 30?
I have an access report that is launched from a form via vba and the NUMBER pages that are "auto printed" are based on a variable (labelsx) created by running a Mod function on the number of records in the report source. (THE PURPOSE IS TO MINIMIZE WASTE OF LABEL STOCK).
i.e.
Dim stDocName As String
On Error GoTo Err_Print_File_Labels_Click
If labelsx < 30 Then
MsgBox ("Not enough for a full sheet of Avery 8366 Labels, please try again later.")
Exit Sub
Else
End If
PAGE_COUNT = Int(labelsx / 30)
DoCmd.SelectObject acReport, "Labels Project_File_Labels_Avery_8366", True
DoCmd.PrintOut acPages, 1, PAGE_COUNT
'------------
After the printout... a seperate non vba macro runs an append query based on the source data of the report, to keep a log of the labels printed.
The problem is the append query is logging all records from the report source...How do I tell the append query to write only the number of records equal to PAGE_COUNT * 30?