Printing from a form

  • Thread starter Thread starter Orlan
  • Start date Start date
O

Orlan

I have a form with two control buttons. One sends an email based on the form,
the other prints a label based on the form, controled by an autonumber ID on
the form. In the past this has always worked for me, but now it won't print
the label (the label is blank). If I choose the menu Record, Refresh, it
works correctly.

Using requery or Save in the coding prior to printing doesn't do it.

Any thing else I can try?

coding on the button is:

Private Sub cmdPrintLabels_Click()
On Error GoTo Err_cmdPrintLabels_Click

Dim stDocName As String

stDocName = "lblStoreLabel"
DoCmd.OpenReport stDocName, acViewPreview, , "[ID] =
Forms!frmAddRecievingEmail![ID]"
'DoCmd.OpenReport stDocName, acViewNormal, , "[ID] =
Forms!frmAddRecievingEmail![ID]"
Exit_cmdPrintLabels_Click:
Exit Sub

Err_cmdPrintLabels_Click:
MsgBox Err.Description
Resume Exit_cmdPrintLabels_Click

End Sub
 
I have a form with two control buttons. One sends an email based on the form,
the other prints a label based on the form, controled by an autonumber ID on
the form. In the past this has always worked for me, but now it won't print
the label (the label is blank). If I choose the menu Record, Refresh, it
works correctly.

Using requery or Save in the coding prior to printing doesn't do it.

Any thing else I can try?
coding on the button is:

Try putting a line in the code to explicitlly save the record before the
OpenReport line:

DoCmd.RunCommand acCmdSaveRecord
 
Thanks, that worked


John W. Vinson said:
Try putting a line in the code to explicitlly save the record before the
OpenReport line:

DoCmd.RunCommand acCmdSaveRecord
 
Back
Top