By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,436 Members | 2,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,436 IT Pros & Developers. It's quick & easy.

Windows Print Dialog box. acCmdPrint. Single Record.

P: n/a
acCmdPrint allows me to print using the Windows Dialog. Since I want
to be able to select the
printer of my choice, this works well. I put his behind a button on a
single form. The problem is, that instead of print the record that is
being displayed, the entire table of data gets printed. How do I print
just the single record being displayed, with the flexibility of
Windows Dialog box that gives me the choice of printers?

Thanks Greg
Nov 15 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sat, 15 Nov 2008 12:46:55 -0800 (PST), "Greg (co*****@gmail.com)"
<co*****@gmail.comwrote:

In the Print dialog specify the page(s) you want to print.

Or run the report with a Where-clause:
docmd.OpenReport "someReport",,,"CustomerID=5"

-Tom.
Microsoft Access MVP

>acCmdPrint allows me to print using the Windows Dialog. Since I want
to be able to select the
printer of my choice, this works well. I put his behind a button on a
single form. The problem is, that instead of print the record that is
being displayed, the entire table of data gets printed. How do I print
just the single record being displayed, with the flexibility of
Windows Dialog box that gives me the choice of printers?

Thanks Greg
Nov 15 '08 #2

P: n/a
The following code seems to work:
Private Sub cmdPRINTRec_Click()
'************************************************* ***
' PRINT Displayed Record. PRINT Record Button.
On Error GoTo Err_Handler:
DoCmd.OpenReport "REPORTNAME", acViewPreview, , "SICKID = " &
Me.SICKID
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, "REPORTNAME", acSaveNo
Me.Refresh
DoCmd.Hourglass (True)
Exit_Point:
DoCmd.Hourglass (False)
Exit Sub
Err_Handler:
DoCmd.Close acReport, "REPORTNAME", acSaveNo
DoCmd.Hourglass (False)
Select Case Err
Case 2212
MsgBox "Cannot Print Now.":
Resume Exit_Point
Case 2501
'MsgBox "Print Has Been Cancelled.":
Resume Exit_Point
Case Else
Resume Exit_Point
End Select
End Sub
Nov 15 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.