Results 1 to 2 of 2
  1. #1
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Plitting a form into maybe subforms

    I teach in a school and am producing a screen to show what proportion of students got a particular grade


    I currently have a form which displays the following

    Grade (a number from 0 to 9)
    count of how many times the grade was achieved
    this proportion as a %

    My line manager would like this broken down to include three such forms



    A breakdown from students who took a lower Foundation paper
    A breakdown from students who took a lower Higher paper
    A breakdown from all students (the form which I have)


    I have a qryGradesforBreakdown which extracts all the results I need for any group of students and the following produces a count of how many of each grade there are

    Code:
    SELECT qryGradesforBreakDown.SlotID_FK, qryGradesforBreakDown.gradewhole, Count(qryGradesforBreakDown.gradewhole) AS CountOfgradewhole
    FROM qryGradesforBreakDown
    GROUP BY qryGradesforBreakDown.SlotID_FK, qryGradesforBreakDown.gradewhole;

    The following query is the control source for my form

    Code:
    SELECT a1.SlotID_FK, a1.gradewhole, a1.CountOfgradewhole, Sum(a2.countofgradewhole) AS Running_Total, Format([Running_Total]/(select sum(Countofgradewhole) from qryBreakDownResults),"Percent") AS Pcent
    FROM qryBreakDownResults AS a1, qryBreakDownResults AS a2
    WHERE (((a1.gradewhole)<=[a2].[gradewhole])) OR (((a1.gradewhole)=[a2].[gradewhole]) AND ((a1.CountOfgradewhole)=[a2].[CountOfgradewhole]))
    GROUP BY a1.SlotID_FK, a1.gradewhole, a1.CountOfgradewhole
    ORDER BY a1.gradewhole, a1.CountOfgradewhole DESC;
    It works perfectly but only shows the breakdown for all 191 students.

    my simple question is can I split this information into three subforms. I have attempted this with very little luck as the Percentage column goes wrong.

    Or should I just stick with a combo box for the view I'd like and use the combobox to filter.


    Very frustrated..

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    i use 2 queries,
    Q1 to get the Total Possible,
    Q2 uses the Student Grades table joined to Q1 to get %.

    this you can show in a subform.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-25-2018, 05:32 PM
  2. Form, Subforms
    By CaliberGX in forum Forms
    Replies: 7
    Last Post: 07-17-2017, 07:17 AM
  3. Replies: 11
    Last Post: 05-13-2015, 11:10 PM
  4. Subforms on form
    By teza2k06 in forum Forms
    Replies: 1
    Last Post: 05-01-2012, 07:59 AM
  5. Form and 3 subforms
    By Mitka in forum Forms
    Replies: 2
    Last Post: 01-15-2011, 02:43 PM

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