M
Reaction score
1

Profile posts Latest activity Postings About

  • Good!
    Of course, with SubQueries in SQL it's most cool.
    As I am not yet very well in SQL, it takes more time for me to find the right solution.
    And it's compulsory to use a table of parameters.
    Good continuation for you.
    I think it's not also easy to give users the possibility to change these values. Another solution is using a table of parameters which they can change as their needs? I look for what is possible and will tell you.
    thank you very much madefemere,
    i have called the function in a query and it works fine.
    am sorry to bother you too much but i am new to vba,i was wondering how i will make this function available for the user in a form, so that they can edit it.
    you see different institutions might have variant grading schemes so this is why i want it available for user to edit the values "valGrade" and "PrMark".
    Hello,
    Here is a vba code to give grade depending on marks of students.
    You use the select case instruction. You can adapt it easily to comment:
    Public Function ValGrade(PrMark As Double) As String
    Select Case PrMark
    Case 80 To 100
    ValGrade = "A"
    Case 75 To 80
    ValGrade = "A-"
    Case 70 To 74
    ValGrade = "B+"
    Case 65 To 69
    ValGrade = "B"
    Case 60 To 64
    ValGrade = "B-"
    Case 55 To 59
    ValGrade = "C+"
    Case 50 To 54
    ValGrade = "C"
    Case 45 To 49
    ValGrade = "C-"
    Case 40 To 44
    ValGrade = "D+"
    Case 35 To 39
    ValGrade = "D"
    Case 30 To 34
    ValGrade = "D-"
    Case Else
    ValGrade = "E"
    End Select
    End Function
    okey, let me make it as simple as possible.
    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.

    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.
    http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=50016&d=1378026553

    Hallo,
    please help me solve this headake.
    can it be possible to customize an if function??
    syntax.
    iif ( condition, value_if_true, value_if_false )
    i mean enable the user to change condition, value_if_true, value_if_false in a form.
    thanks in advance.
  • Loading…
  • Loading…
  • Loading…
Top Bottom