Solved

Printing single record supreports in Access 2010

Posted on 2012-12-29
4
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

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 40

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 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