Textbox total on form

  • Thread starter Thread starter SueM
  • Start date Start date
S

SueM

Hi,

I have a form with 15 textboxes on it. Each contains a
value that I want to total in another textbox at the
bottom of the form.

I've got this to work in 2 ways. The first through a query
and the second through an onclick event.

With my query total the textbox total would not update,
even with me.textboxtotal.requery and/or
me.textboxtotal.value = null afterupdate events in the
textboxes containing the values.

Which is why I moved on to the on click event.

The on click event works fine, but I don't want to have to
click in the totals textbox each time I update one of the
textboxes containing a value.

How do you create an event that will update the totals
textbox anytime any of the value ones are updated?

Cheers
 
SueM said:
I have a form with 15 textboxes on it. Each contains a
value that I want to total in another textbox at the
bottom of the form.

I've got this to work in 2 ways. The first through a query
and the second through an onclick event.

With my query total the textbox total would not update,
even with me.textboxtotal.requery and/or
me.textboxtotal.value = null afterupdate events in the
textboxes containing the values.

Which is why I moved on to the on click event.

The on click event works fine, but I don't want to have to
click in the totals textbox each time I update one of the
textboxes containing a value.

How do you create an event that will update the totals
textbox anytime any of the value ones are updated?


You should be using an expression in the form footer's text
box. Generally, it would be the same expression you were
using in the query preceeded by an = sign. E.g.

=field1 + field2 + . . .

If any of those fields might be Null and you want to use 0
for those fields, then use the Nz function:

=Nz(field1,0) + Nz(field2,0) + . . .
 
Thanks - this worked really well
-----Original Message-----



You should be using an expression in the form footer's text
box. Generally, it would be the same expression you were
using in the query preceeded by an = sign. E.g.

=field1 + field2 + . . .

If any of those fields might be Null and you want to use 0
for those fields, then use the Nz function:

=Nz(field1,0) + Nz(field2,0) + . . .
 
Back
Top