?
Solved

Printing single record supreports in Access 2010

Posted on 2012-12-29
4
Medium Priority
?
287 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 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 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