place total from report on a form

R

Roger

AT present I use a form to balance my cash drawer at the end of the day. I
run a report and then type in the total income shown on the report for the
day on the form. Is there a way I can place the total from the report on the
form so I don't have to view the actual report?
 
D

Dirk Goldgar

Roger said:
AT present I use a form to balance my cash drawer at the end of the day. I
run a report and then type in the total income shown on the report for the
day on the form. Is there a way I can place the total from the report on
the
form so I don't have to view the actual report?


Almost certainly, but you haven't given enough information for us to say
houw to accomplish it. The total wouldn't normally come from the report
itself, but rather from a query of the same table or tabels that the report
is based on. Is the same information present on your form, in untotaled
form?
 
R

Roger

The total is the result of an unbound calculated control on the report based
on adding the result of several other bound controls on the report, Naturally
the bound controls are based on the results of a query. I call this report my
income report and it displays the results of both retail and service sales
plus tax, backbar usage and etc by employee/stylist for the dates intered
when the query is run. I dont need all this info to balance my cash drawer. I
just want a way to place the total from the reports unbound calculated
control on the cash drawer form after the report is run. I don't need
employees to see what each other made etc..just a total for the day so they
can balance the register for the day
Hope this helps explain what I need
Thanks
Roger
 
D

Dirk Goldgar

Roger said:
The total is the result of an unbound calculated control on the report
based
on adding the result of several other bound controls on the report,
Naturally
the bound controls are based on the results of a query. I call this report
my
income report and it displays the results of both retail and service sales
plus tax, backbar usage and etc by employee/stylist for the dates intered
when the query is run. I dont need all this info to balance my cash
drawer. I
just want a way to place the total from the reports unbound calculated
control on the cash drawer form after the report is run. I don't need
employees to see what each other made etc..just a total for the day so
they
can balance the register for the day
Hope this helps explain what I need


No, not really. Remember that neither reports nor forms actually hold data;
only tables hold data. So while it would be technically possible to put
code in the report that snags the total when the report is run and sticks it
into a field in a record in a table, that would really not be the right way
to do it. It's bad idea to store a data value that can be calculated.
Instead, we need to determine what calculation, performed on what query, is
necessary to arrive at the result, and then set up a calculated control on
your form that uses a DLookup or DSum expression to perform the calculation.

A good starting point would be the SQL of the report's recordsource query,
and the controlsource and other relevant properties of the text box on the
report that displays the total. That will doubtless lead to further
questions, but it would be a start.
 
K

Ken Sheridan

Roger:

Its possible by opening the report invisibly while the form is open and, in
the Print event procedure of the whatever section the compute control in the
report is located, assign the value to the control on the form. But it’s a
very roundabout and inefficient way of doing it.

As Dirk said the value can be obtained from the data in exactly the same way
it is by the computed control in the report and assigned to the control on
the form. This will probably involve calling things like the DSum function
for different types of data (retail, service sales etc) and adding the return
values as appropriate. As the query exists already this should not be
difficult. If you can tell us what the basis for the computation to fill the
unbound control in the report is we may be able to be more categorical in
suggesting a solution.

Ken Sheridan
Stafford, England
 
R

Roger

Thanks to both of you for your responses. I think I understand what is
involved now and what I need to do.
Roger
 
F

franco

Ken Sheridan said:
Roger:

Its possible by opening the report invisibly while the form is open and,
in
the Print event procedure of the whatever section the compute control in
the
report is located, assign the value to the control on the form. But it’s
a
very roundabout and inefficient way of doing it.

As Dirk said the value can be obtained from the data in exactly the same
way
it is by the computed control in the report and assigned to the control on
the form. This will probably involve calling things like the DSum
function
for different types of data (retail, service sales etc) and adding the
return
values as appropriate. As the query exists already this should not be
difficult. If you can tell us what the basis for the computation to fill
the
unbound control in the report is we may be able to be more categorical in
suggesting a solution.

Ken Sheridan
Stafford, England
 

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