H
hdfixitup
I currently print labels based on a report and get one label for each record.
I would like to key in the number of labels for each record prior to saving
my order and have my report print the requested quantity for each record
showing in the report. My code is:
Function Print_Report()
On Error GoTo Print_Report_Err
Dim Counter As Integer
Dim ReportDest As String
'Hide the form PrintReportsDialog
Forms![PrintReportsDialog].Visible = False
'Destination is Print Preview
If Forms![PrintReportsDialog]![Type of Output] = 1 Then
ReportDest = acNormal
Else 'Destination is Printer
ReportDest = acPreview
End If
With CodeContextObject
' Attached to the Print button on the PrintReportsDialog form
Select Case .[Report to Print]
Case 1 'Labels
'Print Labels for Order Report
Do While Counter < .[Number of Copies]
If Forms![PrintReportsDialog]![Select Order Type] = 1 And
Forms![PrintReportsDialog].[Select Number] = 1 Then
DoCmd.OpenReport "rptOrder", ReportDest, ,
Eval("IIf(Forms![PrintReportsDialog]![Select List] Is Null,"""",""[OrderID] =
Forms![PrintReportsDialog]![Select List]"")")
End If
Counter = Counter + 1
Loop
ANY HELP would be appreciated on how to accomplish.
Thanks
I would like to key in the number of labels for each record prior to saving
my order and have my report print the requested quantity for each record
showing in the report. My code is:
Function Print_Report()
On Error GoTo Print_Report_Err
Dim Counter As Integer
Dim ReportDest As String
'Hide the form PrintReportsDialog
Forms![PrintReportsDialog].Visible = False
'Destination is Print Preview
If Forms![PrintReportsDialog]![Type of Output] = 1 Then
ReportDest = acNormal
Else 'Destination is Printer
ReportDest = acPreview
End If
With CodeContextObject
' Attached to the Print button on the PrintReportsDialog form
Select Case .[Report to Print]
Case 1 'Labels
'Print Labels for Order Report
Do While Counter < .[Number of Copies]
If Forms![PrintReportsDialog]![Select Order Type] = 1 And
Forms![PrintReportsDialog].[Select Number] = 1 Then
DoCmd.OpenReport "rptOrder", ReportDest, ,
Eval("IIf(Forms![PrintReportsDialog]![Select List] Is Null,"""",""[OrderID] =
Forms![PrintReportsDialog]![Select List]"")")
End If
Counter = Counter + 1
Loop
ANY HELP would be appreciated on how to accomplish.
Thanks