Jump to content

conditional value list on calculation field


This topic is 2775 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies



Sorry for the question... certainly asked numerous times.

I am spending two days trying to understand the concept but didn't catch the idea to implement it.

My database is a medical invoices one.
I have one table for patients administration (one of the fields is a calculation field with his/her age in years depending of the birthdate),
one for invoices,
another one for invoice lines,
and another one for medical examinations provided by our office (including the Minimum patient age and the Maximum patient age for each exam).

The medical exams list is provided by a pop up menu for each invoice lines.
After selecting the appropriate exams, the price of the exams are populated and the total of the invoice is calculated.

At this point, every thing is ok...
but I need to limit the available choices of medical exams in the pop up menu to the exams possible for each patient depending his/her age.

I failed to success with error "index Missing".

Please may you provide the best practice in this kind of situation?

Thank you. 

Link to comment
Share on other sites

You need to start by defining a relationship between Patients and an occurrence of the Exams table (here, I will call it AvailableExams) as:

Patients::cAge ≥ AvailableExams::MinimumAge
Patients::cAge ≤ AvailableExams::MaximumAge

Then define your value list to use values from AvailableExams::ExamID, show only related values starting from Patients.

This is assuming you are selecting the exam in a record of the LineItems table that is already related (through Invoices) to a patient in the Patients table (and therefore also related to the available exams in the AvailableExams TO).

Caveat: untested.

Edited by comment
Link to comment
Share on other sites

This topic is 2775 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.