Totals in an unbound form

G

Guest

I have an unbound form which currently has 8 invisible sub forms based on 8
simple criteria queries. Each query uses the same date range paramter based
on 2 text boxes on the main form.
The user enters the date range on the main form and clicks a command button
which requeries each of the invisible sub forms. Each of these in turn have
a totals box in the footer of each form.
I have 8 unbound text boxes whos data source is the total box on each form.
These 8 unbound text boxes on the main form then display the total from each
of the sub forms thereby providing a summary.
Is it possible to remove the subforms and have the text boxes data source
set to Sum the query directly once the command button is clicked.
The reason for this is that the form is slow to load, I assume due to the
amount of sub forms and these are firstly invisible and secondly need to be
requeried with the date criteria anyway.
I hope this makes sense and would be grateful of any help
I am using Access 2003.
Thanks.
 
P

Pieter Wijnen

Use DSum on Each of the underlying queries
ControlSource: = DSUM("TheField","TheSubQuery","DateField Between " &
[txtDateFrom] " AND " & [txtDateTo])

HTH

Pieter

Simon said:
I have an unbound form which currently has 8 invisible sub forms based on 8
simple criteria queries. Each query uses the same date range paramter
based
on 2 text boxes on the main form.
The user enters the date range on the main form and clicks a command
button
which requeries each of the invisible sub forms. Each of these in turn
have
a totals box in the footer of each form.
I have 8 unbound text boxes whos data source is the total box on each
form.
These 8 unbound text boxes on the main form then display the total from
each
of the sub forms thereby providing a summary.
Is it possible to remove the subforms and have the text boxes data source
set to Sum the query directly once the command button is clicked.
The reason for this is that the form is slow to load, I assume due to the
amount of sub forms and these are firstly invisible and secondly need to
be
requeried with the date criteria anyway.
I hope this makes sense and would be grateful of any help
I am using Access 2003.
Thanks.



--
 

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