Initializing a subform

J

Joy M

Hi -

I am coding an Invoice form called frmInvoice. It has a subform called
subfInvoiceDetails.

frmInvoice has a Total Premium that is paid to a Insurance Company for
insuring the policy.
subfInvoiceDetails has a possibility that 1 or more companies insure the
policy.
We would need 1 record for each company that participates in the insuring of
this policy which is being invoiced.

Most of the time only one company does the insuring.
It would be the same company as on the parent form, and the premium would
also be the same as on the parent form.
So most of the time each Invoice would have 1 child record Invoice Details

Initially we want to initialize 2 fields in the subform to 2 fields in the
parent form, namely
Set idCompanyCode equal to invSelectCompany
Set idPremium equal to invTotalPremium.

Is it possible to do this? In which module, in which event do I do this?
Do I do it on the subform or on the form?

There is another restriction, I am using the AllowAdditions, AllowEdits and
AllowDeletions Properties as follows.
When the Invoice form opens, the subform will not allow additions, editing
or deletions.
Then I save the Invoice record by pressing a command button, and the Invoice
cannot allow add/change/delete.
Then I allow InvoiceDetails to have add/change/delete functionality.

It is here where I want to initialize the 2 values, i.e. idCompanyCode to
invSelectCompany and idPremium to invTotalPremium.
(I assume that using these 3properties will create the effect I want of
locking/disabling the form and subform one at a time, but
maybe there is a better way of doing this. So I am open to advice here
also.)

Thank you very much. I feel very grateful for your explanations and
instructions.
Joy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top