Print a report of a Single Record from a Form

Pappy

Registered User.
Local time
Today, 11:54
Joined
Jun 12, 2003
Messages
28
I need to print a single record that shows up on a form. The form has a button that when pressed should print a report. When I press it, it prints out the entire report. I want it to just print the single record. Any help would be much appreciated. Thanks

Pappy
 
Use the Where clause:

Code:
DoCmd.OpenReport "RptName", , , "RecordOnReportID =" & Me.RecordOnFormID

Brad
 
still need help

Private Sub Command44_Click()
On Error GoTo Err_Command44_Click

Dim stDocName As String

stDocName = "rptJanSingle"

DoCmd.OpenReport "rptJanSingle", , , "Policy # = " & Me.Policy

Exit_Command44_Click:
Exit Sub

Err_Command44_Click:
MsgBox Err.Description
Resume Exit_Command44_Click

End Sub

I get the error

"Syntax Error in date in query expression '(policy # = ********)' "
 
Hi Pappy,

"Syntax Error in date in query expression '(policy # = ********)' "

should be [policy #]

It is best not to put spaces and/or special characters in the
names of your controls.

The parser expects:

Field = 'Something'

It encounters your pound sign when it is expecting equals.

Wayne
 

Users who are viewing this thread

Back
Top Bottom