Sum in continuous form

H

Haim Beyhan

Hi,

I'm using Access XP with SQL Server 2000 on Windows 2000/XP machine. I have
a continuous form that its control source is stored procedure.
There are 3 sums and one count textbox in form footer. The stored procedure
should bring ~4000 records and run the sums in form footer.
Every time I open the form, the count is only 50 and the sums do not reflect
the exact sums. If I wait then there is no refresh but if I do pagedown,
then the count and sums are updated to the correct values.
I tried to put refresh, calc, paint in the formopen event. But nothing
helps. I read in some newsgroups that people are talking about running sum.
Do I need it? Why can't I use the regular "sum(field1)" ?
I tried also to write a procedure that takes the clone of the recordset and
sums the fields in each record. I removed the count and sums from form
footer textboxes. Then I put the value 2000 ms in timer interval of the
form and called the runningsum procedure from within the ontimer event. This
way when I open the form, the count and sums fields are empty and then after
2000ms(2 sec), I get the correct count and sums.

Is this the correct way to get sums ? Any suggestions ?


Thanks in advance,

Haim Beyhan
 
M

MGFoster

It seems to be the only way. I had a similar problem & solved it the
same way you did - putting in a pause routine before reading the summed
TextBox.
 
H

Haim Beyhan

Thanks for the reply.
I tried another thing right now and it worked for me. I still left the count
and sum fields in formfooter with the relevant controlsource.
Then I added the following lines under formopen event. It takes a little bit
time but it works.

DoCmd.RunCommand acCmdRecordsGoToLast
DoCmd.RunCommand acCmdRecordsGoToFirst


Haim Beyhan
 

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