Hi
I have a button on a form which is used to print shipping labels.
This button runs a Query and then a report using the code below.
But I need both the query results and the report to not be seen. All I want to happen when clicking the button is that a label is printed.
Any Help would be most appreciated
I have a button on a form which is used to print shipping labels.
This button runs a Query and then a report using the code below.
Code:
Private Sub SaveBtn_Click()
DoCmd.SetWarnings False
DoCmd.RunSQL "Update BookInTable SET DateBookedOut = '" & Me!DateTxt & "' WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.RunSQL "Update BookInTable SET BookedOut = True WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.OpenQuery "PrintLabelQuery"
DoCmd.OpenReport "Labels", acViewPreview
DoCmd.PrintOut , , , , 1
DoCmd.SetWarnings True
End Sub
But I need both the query results and the report to not be seen. All I want to happen when clicking the button is that a label is printed.
Any Help would be most appreciated