D
dbb1970
Hi
i change subform childlink via selection on combobox in after event using
following code:
Me.Subform.LinkChildFields = "SomeField"
which works fine. but i also have a field on main form which adds together
totals from 2 subforms. after changing childlink the field on the main form
shows #Error, even though the totals on each subform still show amounts. i
use the following code to add together the 2 subform totals:
=IIf([Forms]![MainForm]![Subform].[Form].[RecordsetClone].[RecordCount]>0,nz([Forms]![MainForm]![Subform]![sumtotal],0),0)+IIf([Forms]![MainForm]![Subform1].[Form].[RecordsetClone].[RecordCount]>0,nz([Forms]![MainForm]![Subform1]![sumtotal],0),0)
the same #Error shows when moving to other records in mainform
any thoughts on why this is happening and how to fix?
thanks
i change subform childlink via selection on combobox in after event using
following code:
Me.Subform.LinkChildFields = "SomeField"
which works fine. but i also have a field on main form which adds together
totals from 2 subforms. after changing childlink the field on the main form
shows #Error, even though the totals on each subform still show amounts. i
use the following code to add together the 2 subform totals:
=IIf([Forms]![MainForm]![Subform].[Form].[RecordsetClone].[RecordCount]>0,nz([Forms]![MainForm]![Subform]![sumtotal],0),0)+IIf([Forms]![MainForm]![Subform1].[Form].[RecordsetClone].[RecordCount]>0,nz([Forms]![MainForm]![Subform1]![sumtotal],0),0)
the same #Error shows when moving to other records in mainform
any thoughts on why this is happening and how to fix?
thanks