Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2011
    Posts
    25

    Unanswered: Help with a simple function!

    Bare with me, as I am BRAND new to access.
    I have two forms. the one form shows CourseID, CourseTitle,EmployeeCourseID,Year,Grade(%),Qualifi ed.

    Grade(%) being a calculated function:
    Grade(%): Sum([Results].[Score]/[Module].[Maximum Points]*[Module].[PercentofGrade]). < which gives the overall grade. now I am wondering if there is some sort of expression or function I can use in that function to say, differenciate the Year ( 2011, 2012, 2013) so when I add in another score for the courses in 2012, it doesnt add on to the already existing years(2011), which it has been doing.

    Thanks in Advance!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    put an additinal parameter to contain the year
    and only retrieve data for that year
    as an option make the parameter optional and if not supplied use all years value
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2011
    Posts
    25
    Unfortunatly, ALL years have to be shown on the form.

    Could it not be a possible function to add into that calculation? or maybe create a new one based on the actual grade(%)?

    Thanks so much!

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry I suspect you are thinking in spreadsheet mode
    write a function which calculates the grade (extracting what ever data it needs, or supply whatever data it needs) the fucntikn returns the grade for the specified values
    so the grade for a years is, say = CalcGrade(thisyear)

    if the function is designed as a generic then it can be used whereever you need to calculate the grade.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Dec 2011
    Posts
    25
    Okay! So would that function be used in the query with the grade(%) calculation function? or? I apologize I am very new to this. and the =Calcgrade(thisyear) function , is the actual function to be used? I guess I know what I need to do but I do not know HOW to do it.

    Thanks a bunch

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    calcgrade was intended to be a user written function to calculate the grade

    how you write it, how you deploy it depends entirely in the table design
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Dec 2011
    Posts
    25
    I appreciate your help. I just cant seem to figure this one out, as I am not familiar at all with codes, and functions.

    I dont mean to press my luck, but is there any way I could send you any information you need in order to write a function for me? ( without sending the dbase, as it is confidental)

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    by all means
    post your table designs
    and/or post your db here as a zip file, stripping out any personal or confidential information
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •