Hi,
I have a form which has a few buttons to print. I want that when someone clicks a button it prints a report but then closes the form. my code seems to close the print window but not the form. See my original code below. I tried changing the close section to the following but got a type mismatch
Code:
Dim stDocName As String
stDocName = "frmMenuLabelPrnt"
DoCmd.close stDocName
Code:
Private Sub Print_Click()
On Error GoTo Print_Click_Err
If Frame16 = 1 Then
DoCmd.OpenReport "PackingCard1", acViewPreview, "", "", acNormal
DoCmd.RunCommand acCmdPrint
Else
If Frame16 = 2 Then
DoCmd.OpenReport "PackingCard2", acViewPreview, "", "", acNormal
DoCmd.RunCommand acCmdPrint
Else
End If
End If
DoCmd.close
Print_Click_Exit:
Exit Sub
Print_Click_Err:
MsgBox Error$
Resume Print_Click_Exit
End Sub