Hi all,
I have a quote form, pictured below:
It accesses data from these 2 tables:
tblQuote (the main one)
and tblQuoteItems (the subform which is as a datasheet style)
Basically, for all the items in the subform, they will each have a value in the subtotal column. I want to sum these items together where the idsQuoteID in the subform is equal to the idsQuoteID in the main form. I then want the summed value to be put into the Ex. VAT total in the main form (just below the datasheet).
I have no idea where to start on the code with this one, I just know it's do-able. So I'd appreciate pointers very much
The code would probably be entered into the onLostFocus() event of the subform so that as soon as the subform is no longer "active", the ex. VAT value of the quote would change.
I guess the logic would go something like:
FOR EACH form_frmQuoteItemsSubform.idsQuoteItemID
WHERE form_frmQuoteItemsSubform.idsQuoteID = me.QuoteID
(me is refering to the main form)
me.QuoteValue = SUM form_frmQuoteItemsSubform.curItemSubTotal
DO UNTIL form_frmQuoteItemsSubform.idsQuoteID is NOT equal to me.QuoteID
I hope that makes some sort of sense.
I look forward to your replies.
Blessings,
Simon Barrett
I have a quote form, pictured below:

It accesses data from these 2 tables:
tblQuote (the main one)

and tblQuoteItems (the subform which is as a datasheet style)

Basically, for all the items in the subform, they will each have a value in the subtotal column. I want to sum these items together where the idsQuoteID in the subform is equal to the idsQuoteID in the main form. I then want the summed value to be put into the Ex. VAT total in the main form (just below the datasheet).
I have no idea where to start on the code with this one, I just know it's do-able. So I'd appreciate pointers very much

The code would probably be entered into the onLostFocus() event of the subform so that as soon as the subform is no longer "active", the ex. VAT value of the quote would change.
I guess the logic would go something like:
FOR EACH form_frmQuoteItemsSubform.idsQuoteItemID
WHERE form_frmQuoteItemsSubform.idsQuoteID = me.QuoteID
(me is refering to the main form)
me.QuoteValue = SUM form_frmQuoteItemsSubform.curItemSubTotal
DO UNTIL form_frmQuoteItemsSubform.idsQuoteID is NOT equal to me.QuoteID
I hope that makes some sort of sense.
I look forward to your replies.
Blessings,
Simon Barrett