Solved

Printing single record supreports in Access 2010

Posted on 2012-12-29
4
282 Views
Last Modified: 2013-01-02
Good day,

I'm having some trouble getting my report in access to print how I want it to. I have a couple of tables I'm trying to work with, one has a list of names and the other has some information about their care. I created two reports called Patients and then Progress_Note, and I want to be able to print out a single report with information from the Patient table and the Progress_Note table.

I tried making a button on the Progress_Note form that looks like
DoCmd.OpenReport "Patients", acViewPreview, , "ID=" & Me.ID

Open in new window


Right now, if I have up record 6 is on the Progress Note, it doesn't print record 6 from the Progress Note table but record 6 from the Patient table. I thought it might be a relationship problem with my database, but my tinkering with that has proven unsuccessful.

I just want to be able to pull up the Progress Note and have it print a single note and pull in the data from the patient table (like the patient name and D.O.B. with the notes from that single progress note.

I've attached the database with some rough data in it for troubleshooting purposes.

Thanks a ton.
29-Dec---V2.accdb
0
Comment
Question by:darantares
  • 2
4 Comments
 
LVL 39

Expert Comment

by:als315
ID: 38730404
Progress_Note table has duplicate fields: Prog_Note_ID and Patient. Why?
You have different ID fields on form and on report. You should add Prog_Note_ID to form and change command to:
DoCmd.OpenReport "Patients", acViewPreview, , "ID=" & Me.Prog_Note_ID
29-Dec---V2.accdb
0
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 38731031
If you like to have only one record in subreport, test this sample (Report1 button)
29-Dec---V2.accdb
0
 
LVL 30

Expert Comment

by:hnasr
ID: 38731389
You may build the report on the query: paqtient_q

SELECT Patients.[First Name], Patients.[Last Name], Patients.Diag_Code, Patients.D_O_B, Patients.Referring_Dr, Progress_Note.Eval_date, Progress_Note.Prog_Note_ID, Progress_Note.Status
FROM Patients INNER JOIN Progress_Note ON Patients.ID = Progress_Note.Prog_Note_ID;

Chek report patient_q

You may filter for required ID when you open the report from the relevant form.
Q-27980794-29-Dec---V2.accdb
0
 

Author Closing Comment

by:darantares
ID: 38738638
Perfect! Does exactly what I want it to, and I was able to modify it to work on another report. Thanks a ton!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Normalization of a table 19 74
Combobox row source 2 20
Create a EXCEL FIle from Access Procedure 1 16
Turn off MS Access Default=0 for Numerics 6 26
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question