There are 2 ways that I can think of. the way I would proably do is make it
a calculated field in a query. Example
iif(mark_field >= 80, "A", iff(mark_field >= 60, "B", iif(mark_field >= 40,
"C", "D"))) as grade_field
another way is to create a module that update grade_field whenever
mark_field is update.
> How do I create one field(grade_field) that automatic load grade (A,B,C or D)
> which "grade_Field" are lookup value from other field such as ("mark_field").
> example: [(marks 80 - 100 grade A), (60 - 79 grade B), (40 - 59 grade C),
> and (0 - 39 grade D)]
> Thank you for somebody like to help me!!!
pacoda_z - 26 Feb 2007 07:45 GMT
Thank You Dhonan, I just received you suggestion, I'll try it.
(another way is to create a module that update grade_field whenever
mark_field is update)
If you don't mind, How to create module?
> There are 2 ways that I can think of. the way I would proably do is make it
> a calculated field in a query. Example
[quoted text clipped - 10 lines]
> > and (0 - 39 grade D)]
> > Thank you for somebody like to help me!!!
John W. Vinson - 26 Feb 2007 17:37 GMT
>Thank You Dhonan, I just received you suggestion, I'll try it.
>(another way is to create a module that update grade_field whenever
[quoted text clipped - 16 lines]
>> > and (0 - 39 grade D)]
>> > Thank you for somebody like to help me!!!
Actually, I would recommend that you take a third option. A module
will certainly work, but it is inflexible and hard to maintain.
What you can do instead is create a small three-field Grades table:
Grades
MarkLow Integer
MarkHigh Integer
Grade Text
with records like
80; 100; "A"
60; 79; "B"
and so on. Join this to your Marks table using a "non equi join" -
first just join the mark_field to MarkLow, then go into SQL view in
the query and edit
INNER JOIN Grades ON yourtable.mark_field = Grades.MarkLow
to
INNER JOIN Grades ON yourtable.mark_field >= Grades.MarkLow AND
yourtable.mark_field <= Grades.MarkHigh
You can then include the Grade field in your form or report.
John W. Vinson [MVP]