Hi All, You've probably come across this problem many times. I've read numerous articles on this, but none address my particular problem.
I have a form [frmLedger] which has a subform [frmInvoice] which in turn has a subform [frmInvoice_Items].
I have a calculated control which is in the footer of [frmInvoice_Items] which I have successfully referenced in [frmInvoice]. i.e. [frmInvoice] shows the Sum of [frmInvoice_Items].[Invoice_Item_Value].
However, I need to show the Total Invoice Value on [frmLedger]. i.e. the Sum Total of the Sum Total.
I have tried to do this using DSum but I can't get the formula to work - it just comes up with 'Error'.
My Tables are as follows:
[tblLedger]
[Ledger_ID]
[tblInvoice]
[Invoice_ID]
[Ledger_ID]
[tblInvoice_Items]
[Invoice_Item_ID]
[Invoice_ID]
[Invoice_Item_Value]
My DSum formula in the [frmLedger] txtTotal_Invoice control looks like this:
=Dsum("[Invoice_Item_Value],"tblInvoice_Items","[tblInvoice_Items]![Invoice_ID]=[tblInvoice]![Invoice_ID] AND [tblInvoice]![Ledger_ID]=[tblLedger]![Ledger_ID]
Am I doing this correctly? or is there a way of doing this through a form? I have read on Office Online about referencing the calculated control in an SQL query, but this makes no sense to me.
Any help would be appreciated,
Richard
I have a form [frmLedger] which has a subform [frmInvoice] which in turn has a subform [frmInvoice_Items].
I have a calculated control which is in the footer of [frmInvoice_Items] which I have successfully referenced in [frmInvoice]. i.e. [frmInvoice] shows the Sum of [frmInvoice_Items].[Invoice_Item_Value].
However, I need to show the Total Invoice Value on [frmLedger]. i.e. the Sum Total of the Sum Total.
I have tried to do this using DSum but I can't get the formula to work - it just comes up with 'Error'.
My Tables are as follows:
[tblLedger]
[Ledger_ID]
[tblInvoice]
[Invoice_ID]
[Ledger_ID]
[tblInvoice_Items]
[Invoice_Item_ID]
[Invoice_ID]
[Invoice_Item_Value]
My DSum formula in the [frmLedger] txtTotal_Invoice control looks like this:
=Dsum("[Invoice_Item_Value],"tblInvoice_Items","[tblInvoice_Items]![Invoice_ID]=[tblInvoice]![Invoice_ID] AND [tblInvoice]![Ledger_ID]=[tblLedger]![Ledger_ID]
Am I doing this correctly? or is there a way of doing this through a form? I have read on Office Online about referencing the calculated control in an SQL query, but this makes no sense to me.
Any help would be appreciated,
Richard