X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Print Multiple Labels, Access 2010    
post Oct 25 2017, 12:55 PM

Posts: 117
Joined: 14-July 16


I need to have access report print 2 labels (duplicate) rather than 1. Any thoughts on how to modify this VBA code?


Private Sub btnDone_Click()
If IsNull(ThisBatchID) Or IsNull(SelectFRex) Or IsNull(NewQtyToDeduct) Or IsNull(NewSlip) Then
MsgBox ("Missing required values")
ThisBatchID = DLookup("BatchID", "tblBatches", "BatchDate=""" & SelectBatchDate & """")
QuantityToDeduct = NewQtyToDeduct * (-1)
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO tblQuantities(BatchID , FRex , ChangeQuantity , Slip , Location , ChangeComments) VALUES (" & ThisBatchID & ",'" & SelectFRex & "','" & QuantityToDeduct & "','" & NewSlip & "','" & SelectLocation & "','" & NewDeductComments & "')")
DoCmd.SetWarnings True

DoCmd.OpenReport "rptDeducting", acViewPreview, , , acHidden
DoCmd.SelectObject acReport, "rptDeducting"
DoCmd.PrintOut acSelection
DoCmd.Close acReport, "rptDeducting"

End If
End Sub
Go to the top of the page
post Dec 4 2017, 11:14 AM

UtterAccess VIP
Posts: 8,464
Joined: 25-October 10
From: Gulf South USA

Hi: I was just looking back through posts that were not answered, and found this from October. Did you solve this issue?

If not ...

I did not follow what you are doing with your code or why, but making duplicates of the labels is simple. If you are using a query as the source for the report, first add a table with one field and make two records: 1 and 2.

Then put the new table in a query along with the query or table currently used as the report record source. Do NOT use a join between the sources. This will create a Cartesian product, making two records for each previous record. Use the new query as the report record source.

You will not have to alter the code you posted, although I wonder why you are calling the report this way ...

See if this does what you are trying to do.


"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page

Custom Search
RSSSearch   Top   Lo-Fi    16th July 2018 - 03:33 PM