Filtering Report to Specific Record

blueydbld9

New member
Local time
Today, 18:20
Joined
Jun 9, 2014
Messages
4
Hi,

I work in psychological testing and I have created a database to store some data for our patients' test scores. I have a main form with demographics and then 5 buttons on the main form that open into 5 other forms (one form for each test). I also have created a button on the main form to run a Report; however, I would like to filter the report to only show the current record (e.g., Patient ID #1 only).

(Can this be done?) How should I go about filtering the report to show only the open record? Expression is preferred - I'm not very good with code.

I'm also assuming that since each form is linked by the primary key of Patient ID, I should be able to see all data from each form (main + 5 others) in the report for that specified Patient ID... (?)

Thank you for your help!
 
Last edited:
This may be showing my ignorance in Access a bit, but for one, I'm not very good with using code. Is there an expression I can just build in a Macro, like OpenReport --> WhereCondition = ???

Also, the link you sent is for opening a Form. If it's a Report that I'm opening, is that still a form? That kind of confused me.
 
Thanks again for your help, pbaldy. I did end up finding another way to do it with a macro expression. I can't show the link since I have fewer than 10 posts, but if anyone else looks at this thread and wants to see how, here's how I did it...

In design view, I clicked on my Report button and opened Properties. For the On Click procedure, I deleted the expression that was there and selected the elipses on the side to create a macro.

From there I chose OpenReport, selected the report I wanted to use for Report Name, and the Where Condition = [PatientID]=[Forms]![frmMain]![PatientID]

Since Patient ID is how I have my forms linked, this seems to work for bringing up the report for all form records for the selected Patient on the main form.
 
Glad you found a solution. Regarding:

Also, the link you sent is for opening a Form. If it's a Report that I'm opening, is that still a form? That kind of confused me.

I mention in the link that the same method can be used to open a report. What you've ended up with is the macro equivalent, which should work fine.
 

Users who are viewing this thread

Back
Top Bottom