Results 1 to 2 of 2
  1. #1
    tlozoot is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2014
    Posts
    2

    Trouble creating this graph

    I have a form for 'Monthly Reviews' of patients wellbeings. The field names are such things as 'Personal Care', ' Diet', and 'Alcohol Management'. Users of the system will use the form to score patients on each area, from 1 to 9. Currently, this is done using a lookup, so the user can choose the value 1-9 from a drop-down menu, and then add any relevant comments in another field.

    Once a user has filled out the form and scored the client on each (11 in total) area, I want to make a graph of the data, so it can be printed off and put in the patient file. I need the fields on the x axis to be the scoring criteria (Personal care, Diet, Alcohol management, etc), and the Y axis to go measure between 1-9.

    How do I do this? The create a chart function in form design seems completely at odds with what I'm trying to achieve, and I think that this is erfectly straightforward to achieve, as a graph.

    Thanks in advance!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Your data structure is not normalized and therefore complicates. Need to rearrange the data with UNION query:

    SELECT 1 AS SeqID, PatientID, "Diet" AS Category, [Diet] AS Score FROM tablename
    UNION SELECT 2, PatientID, "Personal Care", [Personal Care] FROM tablename
    UNION SELECT 3, PatientID, "Alcohol Management", [Alcohol Management] FROM tablename;

    Then use that query as source for graph RowSource which will be like:

    TRANSFORM First(Query1.Score) AS FirstOfScore
    SELECT Query1.Category
    FROM Query1
    WHERE (((Query1.PatientID)=[enter patientID]))
    GROUP BY Query1.Category
    PIVOT Query1.SeqID;

    Compare those results with this RowSource:

    SELECT Category, Score FROM Query1 WHERE PatientID=[enter patientID];

    The PIVOT seems best for a bar graph if you want each bar with different color and the simple SELECT would work for a line or scatter. Both need to be filtered to single patient, which is what you requested.
    Last edited by June7; 05-03-2014 at 11:40 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating a Relationship? (Having trouble)
    By lpmndcte in forum Access
    Replies: 3
    Last Post: 05-17-2012, 06:53 AM
  2. Replies: 6
    Last Post: 02-29-2012, 03:13 AM
  3. Replies: 3
    Last Post: 01-10-2011, 10:31 AM
  4. Replies: 0
    Last Post: 03-04-2010, 06:18 PM
  5. trouble creating correct criteria
    By pshawk in forum Queries
    Replies: 1
    Last Post: 02-12-2010, 01:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums