Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

openreport action what code to use

Status
Not open for further replies.

63busguy

Technical User
May 9, 2008
1
0
0
US
I did read previous posts on this topic in the forum and could not find exactly what I needed.

New to VB code - I want to put a command button on a form that prints the current record to an existing report. The current code prints all of the thousands of records in the database to my existing report.

Here is the current code:

Private Sub print_qt_notice_button_Click()
On Error GoTo Err_print_qt_notice_button_Click

Dim stDocName As String

stDocName = "Quarantine Notice"
DoCmd.OpenReport stDocName, acNormal

Exit_print_qt_notice_button_Click:
Exit Sub

Err_print_qt_notice_button_Click:
MsgBox Err.Description
Resume Exit_print_qt_notice_button_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top