Running Total & DLOOKUP

B

Bardia

On deposit form in Access 2003 Access I have control for Running total for
deposit amount. I used the SUM function in control source of the form control
“=Sum([DepoAmnt])â€.
This function works well in the form and keeps adding the amounts to Running
Total control, but when I look at the related TABLE all I see are ZEROS in
table field. I need this total in the table because I want to use the
DLookup from another form to retrieve the value of Running Total. What I do
wrong? Let me add that I recently started to learn Access.
Please advice.
 
J

Jack Cannon

Bardia,

It sounds that your objective is to store the Deposit Amount in a table for
the purpose of reading that amount with another form.

The command, "=Sum([DepoAmnt])" will not store a value into a table. It
will only compute the amount for the purpose of viewing it on a screen or
printing it on a report. Have you considered using a summary query (also
called a Totals or Group By query)? That would allow the second form to
obtain the information without actually storing a value.

If you need to store the actual amount in a table you will have to use the
AddNew or Update function of a recordset or alternatively use the appropriate
INSERT INTO or UPDATE sql commands. Such commands can be executed from
within the first form.

Jack Cannon
 
T

tina

when you set a control's ControlSource to

=anything

it is by definition a calculated control, unbound - that is, it is *not
bound* to a field in the form's underlying RecordSource. to store the value
in the table field, you have to set the control's ControlSource to the name
of the field in the underlying table, and then assign a value to the
control, either in VBA or by using a SetValue macro.

having said that, i must also add that storing a calculated value in a table
is a violation of normalization rules. you should have a solid business or
technical reason for doing so. the standard procedure is to store the raw
numbers, and calculate the value you need at runtime, in a query, form, or
report.

hth
 
A

a a r o n . k e m p f

I just use the 'RunningTotal' function in SQL Server Reporting
Services--
it works like a charm for things like this, you can pass multiple
arguments, like Sum, County, etc as arguments

SSRS made Access 100% obsolete, sorry-- but you should have done a
better job of keeping up with the times!
 
A

Aaron Kempf knows nothing

a a r o n . k e m p f @ g m a i l . c o said:
I just use drugs, beat cats and old people and generally don't know what the hell I'm talking about.
 

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