J
Joy M
Hi -
I am doing a database that keeps track of insurance policies for an
insurance agent.
The Invoice table (parent) contains the total premium (for a policy), the
Invoice Company table (child) contains premiums which add up to the total
premium.
For example, in the Invoice table, Car Premium = $500.
In the Invoice Company table
1st record - company is State Farm, premium is $200
2nd record - company is ING, premium is $300
The operator is entering this information onto a form and subform.
We do not want to save the records in the subform if the premium amounts do
not add up to the total premium, because we don't want the database to be
out of balance, ever.
One way we thought of doing this was to extend the Invoice record with say
10 multiples of the 5 fields in the Invoice Company table, in the unlikely
event that the total premium was spread over 10 companies. Most of the time
it is one company, some times it is 2 or 3 companies. This way when the
Invoice record is written, we know it is in balance, but this method wastes
space.
Another choice would be to store the information on the form into a
temporary table and when everything added up properly, then write the
records to the Invoice Company table. In both of these ways, we do not save
information that is not in balance.
So can you give me some advice on how to go?
And if temporary tables are to be used, then - briefly - how do I do it? Do
you know of any examples I can look at?
Thanks so much!
Joy
I am doing a database that keeps track of insurance policies for an
insurance agent.
The Invoice table (parent) contains the total premium (for a policy), the
Invoice Company table (child) contains premiums which add up to the total
premium.
For example, in the Invoice table, Car Premium = $500.
In the Invoice Company table
1st record - company is State Farm, premium is $200
2nd record - company is ING, premium is $300
The operator is entering this information onto a form and subform.
We do not want to save the records in the subform if the premium amounts do
not add up to the total premium, because we don't want the database to be
out of balance, ever.
One way we thought of doing this was to extend the Invoice record with say
10 multiples of the 5 fields in the Invoice Company table, in the unlikely
event that the total premium was spread over 10 companies. Most of the time
it is one company, some times it is 2 or 3 companies. This way when the
Invoice record is written, we know it is in balance, but this method wastes
space.
Another choice would be to store the information on the form into a
temporary table and when everything added up properly, then write the
records to the Invoice Company table. In both of these ways, we do not save
information that is not in balance.
So can you give me some advice on how to go?
And if temporary tables are to be used, then - briefly - how do I do it? Do
you know of any examples I can look at?
Thanks so much!
Joy