Run report based on current record? (1 Viewer)

pokerace

Registered User.
Local time
Today, 09:52
Joined
May 13, 2008
Messages
31
I have a report named CaseNotes. I have inserted a command button on a form linking to the report, and I would like the report to be run for only the current record, by using the Client.Client ID field. How can I accomplish this?

I have tried the following code in both the OnClick and OnEnter, but the report still produces the results for all records.

DoCmd.OpenReport "CaseNotes", acViewPreview, , _
"[Client ID]=Forms!CaseNotes !Client ID"
 
Last edited:

pokerace

Registered User.
Local time
Today, 09:52
Joined
May 13, 2008
Messages
31
Got it. Had the wrong form name in the code.

DoCmd.OpenReport stDocName, acPreview, , "[Client ID]= forms![Form Client Information]![Client ID]"
 

Users who are viewing this thread

Top Bottom