Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005

    Unanswered: Form and two subforms calculations

    I have a problem with main form and two subforms in it. Both subforms are in "continuos" mode, and each of them has field in footer, where it calculates total sum for all field that are in it.

    Then there is main sum below both subforms (all this is in detail section of form) and it calculates total for both sums of each subform.

    Whenever i fill values in first subform and in second subform, i have results everywhere, but if i fill values in first subform but leave second subform empty, the "main sum" below both subforms is empty also....

    The control source for main sum field is "=Forms!frmMainForm!frmSubform1!Text1 + Forms!frmMainForm!frmSubform2!Text2" where Text1 is "total sum" in first subform and Text2 is "total sum" in second subform...

    I set default value = 0 for all fields in both subforms, but it won't help....still shows empty fields in that subform, which isn't filled....Actually when i open form for the first time, it shows "0" values in all empty fields and then immediately clears them and shows empty fields...

    Any ideas how i could solve it?


  2. #2
    Join Date
    Sep 2003
    Uh yeah ... 1,000,000 + Null = Null

    Try modding your calculations using the NZ function to set a default value of 0 when either field is empty ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Oct 2005
    This is in textbox properties under control source?

    any example?


  4. #4
    Join Date
    Dec 2002
    Préverenges, Switzerland
    "=nz(Forms!frmMainForm!frmSubform1!Text1, 0) + nz(Forms!frmMainForm!frmSubform2!Text2, 0)"

    nz(blah, whatever)
    replaces any null blah with whatever

    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts