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
DatabasesMicrosoft Access

Avatar of undefined
Last Comment
bobrossi56
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of bobrossi56
bobrossi56

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of PatHartman
PatHartman
Flag of United States of America image

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.
Avatar of bobrossi56
bobrossi56

ASKER

Thanks so much
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo