My database prints several different types of labels. We start with a separate form for each type where the user enters the data to go on the label. Before printing, the user enters the number of copies needed in a text box on the form. Although the coding for the print button is the same on all forms, some work and some don't. I've compared line for line and they look the same. The code is below; we pick up the number of copies in this case from text box Text65.
Dim LabelNumber As Integer
LabelNumber = Forms![fSpecialLabel]![Text65]
DoCmd.OpenReport "rSpecialFormulaWithIngredients", acViewPreview
DoCmd.PrintOut , , , , LabelNumber
When debugging, Access highlights the last line shown above. It also gives the value of the LabelNumber, which is always the value we put into the text box.
I've tried just typing a number in the last line, instead of the LabelNumber variable but it doesn't accept that, either.
Dim LabelNumber As Integer
LabelNumber = Forms![fSpecialLabel]![Text65]
DoCmd.OpenReport "rSpecialFormulaWithIngredients", acViewPreview
DoCmd.PrintOut , , , , LabelNumber
When debugging, Access highlights the last line shown above. It also gives the value of the LabelNumber, which is always the value we put into the text box.
I've tried just typing a number in the last line, instead of the LabelNumber variable but it doesn't accept that, either.