how with one button print all records in Continuous Forms

D

Damon

here is a beginers problem...
there is a single form named master_code . Olso there is a Continuous
subform named item_code.
in the subform there is a text box and a print button that opens another
form that shows the details of the item code and print them.
so depenting to the master code there is a different number of item codes.
how can i create a button that run all the print buttons whith one click?
here is the code for the print button:

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim MyForm As Form
stDocName = ChrW(83) & ChrW(66) & ChrW(70) & ChrW(82) & ChrW(77) &
ChrW(95) & ChrW(917) & ChrW(921) & ChrW(916) & ChrW(927) & ChrW(931) &
ChrW(95) & ChrW(100) & ChrW(101) & ChrW(116) & ChrW(97) & ChrW(105) &
ChrW(108)
stLinkCriteria = "[item_code]=" & "'" & Me![item_code] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.SelectObject acForm, stDocName, True
Set Application.Printer = Application.Printers("zebra tlp 2742")
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click

End Sub

thank you in advance!
 
D

Damian S

Hi Damon,

Put a button on the main form that opens a report which selects all item
data and sub items etc as necessary, grouping and sorting them as required.

Print this report.

Hope this helps.

Damian.
 

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

Top