Share via

Form footer, =Sum(), #Error in footer problem

Anonymous
2023-02-27T17:22:52+00:00

I have seen many postings with this issue and have been unable to resolve my issue.

I have a continuous form with two fields, 'TaskDate' and 'DoByDate'. They are date fields in the table. Next to it, I have an unbound text box labelled 'var_Days' format=standard number and with the expression =([DoByDate]-[TaskDate]), and this returns a value. i.e. the difference in between the two dates in days. So far so good. All rows have a value. There are no gaps.

In the form footer, I have an unbound text box which has the expression =sum(var_Days); I have also tried =Sum(NZ([Var_Days],0)). Both return the #Error on form view.

Is there something I am missing?

Microsoft 365 and Office | Access | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2023-02-27T18:34:20+00:00

    If [DoByDate] and [TaskDate] are both date or numeric fields in the form's record source the expression should work. Does your code compile? Try remove the Sum() to see if you get a value.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-02-27T18:07:02+00:00

    Thank you

    Yes, I regret that returns the same #Error as well

    Was this answer helpful?

    0 comments No comments
  3. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2023-02-27T17:57:48+00:00

    You can’t sum a control. You can use:

    =Sum([DoByDate]-[TaskDate])

    Was this answer helpful?

    0 comments No comments