Solved

Printing single record supreports in Access 2010

Posted on 2012-12-29
4
281 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now