Results 1 to 8 of 8
  1. #1
    SashaSandy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    12

    customize a function in a form.

    Hi!!
    I have a query that i would like to make it as custom as possible.
    It grades students according to marks achieved, however grading systems may vary in different institutions or so.
    I know there may be two approaches in tackling this like using a Table or parameter queries but i seem to end up in the same mess either way.
    i use the following function to show grade:
    Code:
    Grade: IIf([Marks]>=80,"A",IIf([Marks]>=75,"A-",IIf([Marks]>=70,"B+",IIf([Marks]>=65,"B",IIf([Marks]>=60,"B-",IIf([Marks]>=55,"C+",IIf([Marks]>=50,"C",IIf([Marks]>=45,"C-",IIf([Marks]>=40,"D+",IIf([Marks]>=35,"D",IIf([Marks]>=30,"D-",IIf([Marks]<30,"E"))))))))))))
    What i want to achieve is to alter the marks and grade as per user requirement in a form.


    can this be possible if so how?
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would likely use a table with 3 main fields; one for the grade and two for the upper and lower limits for that grade. You can then have a form for the user to maintain the values. You can get the grade via any number of methods, including for this example a non-equi join.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    SashaSandy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    12
    Quote Originally Posted by pbaldy View Post
    I would likely use a table with 3 main fields; one for the grade and two for the upper and lower limits for that grade. You can then have a form for the user to maintain the values. You can get the grade via any number of methods, including for this example a non-equi join.
    thank you for your rep, the thing is those "many number of methods" am finding it veery hard to tackle. let me make it simpler to understand.

    this is what i want to achieve.
    I have a table of marks of student, a query that calculates totals and a form that displays results.
    on the query, i have an if statement.

    Code:

    comment:IIf([Marks]>=80,"good",IIf([Marks]>=50,"fair",IIf([Marks]>=40,"Work harder")))

    So i want to be able to make the whole syntax available for user to edit without
    actually doing it in vba.
    is this possible in vba? i would really appreciate your help.
    i have attached an image that will help you understand exactly what i mean.
    Attached Thumbnails Attached Thumbnails Capture.JPG  

  4. #4
    SashaSandy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    12

    this is what i want to achieve

    i hope this image explains further.

    Click image for larger version. 

Name:	final.jpg 
Views:	10 
Size:	114.7 KB 
ID:	13651
    Last edited by SashaSandy; 09-03-2013 at 12:00 AM.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I understand what you want. The structure you've chosen is harder to work with than the one I recommended. With mine, it's a relatively simple process of finding the value where the mark is >= the lower limit and <= the upper limit. It can be done with a DLookup() or in your query, a non-equi join.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    SashaSandy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    12

    [solved]

    Quote Originally Posted by pbaldy View Post
    I understand what you want. The structure you've chosen is harder to work with than the one I recommended. With mine, it's a relatively simple process of finding the value where the mark is >= the lower limit and <= the upper limit. It can be done with a DLookup() or in your query, a non-equi join.
    Thank you very much, i finally found a working solution. After i did a thorough search on the web i used the following SQL statement.

    Code:
    SELECT SM.Student_ID, SM.Students, SM.Marks, GD.GradeFROM tblStudentMarks AS SM, tblGradeDenormalized AS GD;
    Attached Files Attached Files

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's the non-equi join I mentioned.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    SashaSandy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    12
    sorry, the full SQL statement for the query is:
    Code:
    SELECT SM.Student_ID, SM.Students, SM.Marks, GD.GradeFROM tblStudentMarks AS SM INNER JOIN tblGradeDenormalized AS GD ON (SM.Marks>=GD.MinMarks) AND (SM.Marks<=GD.MaxMarks);

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

Similar Threads

  1. Need to customize error statements in form
    By mfmathes in forum Access
    Replies: 4
    Last Post: 04-01-2013, 07:26 AM
  2. Need to customize error statements in form
    By mfmathes in forum Programming
    Replies: 1
    Last Post: 03-29-2013, 07:38 AM
  3. Customize Report X of Y
    By sachinmalik007 in forum Access
    Replies: 3
    Last Post: 05-04-2012, 08:45 AM
  4. Customize button "goto last record"
    By bertenbert in forum Forms
    Replies: 1
    Last Post: 12-30-2010, 08:38 AM
  5. Customize Message Box On Command
    By jpkeller55 in forum Access
    Replies: 3
    Last Post: 09-08-2010, 09:18 PM

Tags for this Thread

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