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!
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!