How do I add a sum of a subform on a parent form?
- From: "Kanga" <Kanga@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 9 Aug 2005 10:09:06 -0700
Hi,
I have two forms and tables say [Invoice Header] and [Invoice Lines].
The tables are joined by [Invoice Number]. I must say for some reason (long
story), the invoice header and lines are fed separately but do tie with each
other.
The user can go in the form header and then open the subform with the line
info. I would like to make it that if the user is updating the one of the
line amounts of the invoice line form, that upon closing the subform the
invoice amount on the header is recalculated.
I tried an update query which looks like
UPDATE [Invoice Header] INNER JOIN [Invoice Line] On [Invoice
Header].[Invoice Number] = [Invoice Line].[Invoice Number] SET [Invoice
Header].[Amount] = SELECT SUM ([Invoice Line].[Amount]) FROM [Invoice Line]
GROUP BY [Invoice Line].[Invoice Number]
WHERE [Invoice Line].[Invoice Number] = Form![Invoice Line].[Invoice Number]
and I get an error "Operation must use an updatable query"
Thanks in advance,
Kanga
.
- Follow-Ups:
- Re: How do I add a sum of a subform on a parent form?
- From: Allen Browne
- Re: How do I add a sum of a subform on a parent form?
- Prev by Date: Re: Query to search entire record, not one field?
- Next by Date: Re: Query to search entire record, not one field?
- Previous by thread: Filling in an array of text boxes based on a query?
- Next by thread: Re: How do I add a sum of a subform on a parent form?
- Index(es):
Relevant Pages
|
Loading