Link to home
Start Free TrialLog in
Avatar of bobrossi56
bobrossi56

asked on

Populate a MS Access field based on contents of 2 other fields.

MS Access newbie that created a simple Access 2007 database used to assign horses to student riders. Fields are Date, StudentName, HorseName, LessonType, Instructor and Fee. When the admin creates a record she will fill in the date, the StudentName, HorseName, LessonType, Instructor are combo boxes that look up the drop down data in their respective tables. The Fee field is manually filled in by the admin based on whatever agreement was made between the student and instructor. All the fields are saved so reports can be run.

Now my client wants to add some "matrix logic" so that the Fee field is auto populated based on the LessonType and Intructor fields. For example the Fee field logic would go something like:
If Instructor = "Ann" and LessonType="30 Min" populate Fee with $15.00
If Instructor = "Kate" and LessonType="1 hour" populate Fee with $60.00

and the 'If Instructor and LessonType' logic would be quite long as they have many Instructors and many LessonTypes. Could be as much as 30 IF lines.

How would I go about making this happen?
Thx Experts...BobR
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here's a picture of multi-field unique index.  Give the index a name and set the unique property to Yes.  On the second and subsequent lines  (up to 10 total), leave the Index Name blank.  That tells Access that each field is part of the previously named index.
User generated imageUser generated image
Avatar of bobrossi56
bobrossi56

ASKER

I guess I am way over my head on this one PatHartman. I will take your suggestion and start another ticket with my new database. Thank you for all your help thus far.
Thanks so much