current record

Sounds like you are invoking the Parameter function when using [square brackets]. Check all the references to the fields are correct.
 
I have tried everything in this thread to get a report to print only the current record. However, each time I try to print I am getting a prompt for the unique ID just like a previous user. I have tried to find any typos but everything looks correct. This is my code:

Private Sub cmdDisplay_Click()
On Error GoTo Err_cmdDisplay_Click
DoCmd.RunCommand acCmdSaveRecord
Dim stDocName As String

stDocName = "rptTabbedActionPlanCopyReport"
strWhere = "[PatientID]=" & Me![PatientID]
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_cmdDisplay_Click:
Exit Sub

Err_cmdDisplay_Click:
MsgBox Err.Description
Resume Exit_cmdDisplay_Click
End Sub

Can anyone find offer any suggestions? Also, just to be sure: is the control name to be used in the Where statement? For example:

"[Unique_Field]=" & Me![Name_of_control]

Thanks
 

Users who are viewing this thread

Back
Top Bottom