Datasheets

E

Emma

Hi I have a datasheet as a subdatasheet in a form. I have a column called
total. which I would like to generate the total once the person enters the
value column. Here's what I would like to happen total = total + value I put
this in the default area but it only changes the first row in the datasheet.
Any ideas?
 
K

Ken Sheridan

Total of what? Is it a total of all values in the Value column? If so you
will need to use a subform rather than a subdatasheet so that you can include
an unbound text box in its footer with a ControlSource of:

=Sum([Value])

You cannot have a linked subform in a parent form which is in continuous
form or datasheet view, however, only where the parent form is in single form
view. One thing you can do, though, is have two correlated continuous
subforms in an unbound parent form. This is done by linking via a hidden
control on the unbound parent form.

If you can explain in more detail what your form represents in terms of the
real world entities, and what it is you want to total then we might be able
to be more specific in our advise. Whatever the situation, one thing is
almost certainly true, which is that you should not have a Total column in a
table. Aggregation is almost always done on the fly as to store the
aggregated values is redundant and leaves the door open to inconsistent data.

Ken Sheridan
Stafford, England
 
E

Emma

Thanks Ken, that really worked well!

Ken Sheridan said:
Total of what? Is it a total of all values in the Value column? If so you
will need to use a subform rather than a subdatasheet so that you can include
an unbound text box in its footer with a ControlSource of:

=Sum([Value])

You cannot have a linked subform in a parent form which is in continuous
form or datasheet view, however, only where the parent form is in single form
view. One thing you can do, though, is have two correlated continuous
subforms in an unbound parent form. This is done by linking via a hidden
control on the unbound parent form.

If you can explain in more detail what your form represents in terms of the
real world entities, and what it is you want to total then we might be able
to be more specific in our advise. Whatever the situation, one thing is
almost certainly true, which is that you should not have a Total column in a
table. Aggregation is almost always done on the fly as to store the
aggregated values is redundant and leaves the door open to inconsistent data.

Ken Sheridan
Stafford, England

Emma said:
Hi I have a datasheet as a subdatasheet in a form. I have a column called
total. which I would like to generate the total once the person enters the
value column. Here's what I would like to happen total = total + value I put
this in the default area but it only changes the first row in the datasheet.
Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top