Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Update table with a Running Total

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KPR - 18 Jan 2008 00:01 GMT
Hi, I have a table [Table1] with the fields laid out like this...

StationID
Date
Value
CumulativeValue

What I need to do through VBA is populate the YTD [CumulativeValue] for each
[StationID] for each [Date]. The dates for each Station run from Apr 1 to Oct
1 and the [Value] field contains an Integer value for each day. So what I'm
really wanting to do is populate the YTD [Value] for each [StationID] for
each [Date].

Thanks,
Ken
Bob Barnes - 18 Jan 2008 00:07 GMT
Instead of storing that CumulativeValue in the Table, you can see that
thru a Query Report where you havs "From - To" dates.

HTH - Bob

> Hi, I have a table [Table1] with the fields laid out like this...
>
[quoted text clipped - 11 lines]
> Thanks,
> Ken
KPR - 18 Jan 2008 15:45 GMT
Hi Bob, this is all archived data that will never change. It's a long story
but for system performace through the web these values all need to be
pre-calculated.

Thanks,
Ken

> Instead of storing that CumulativeValue in the Table, you can see that
> thru a Query Report where you havs "From - To" dates.
[quoted text clipped - 16 lines]
> > Thanks,
> > Ken
Bob Barnes - 18 Jan 2008 16:51 GMT
If it MUST be done, you can write code to get the previous month's "CumTotal"
and add the required values in the current month's record to that and
populate the
current month's "CumTotal".

HTH - Bob

> Hi Bob, this is all archived data that will never change. It's a long story
> but for system performace through the web these values all need to be
[quoted text clipped - 23 lines]
> > > Thanks,
> > > Ken
KPR - 18 Jan 2008 17:11 GMT
That's what I'm after....the code for the VBA loop that will do this for me
Station by Station.

> If it MUST be done, you can write code to get the previous month's "CumTotal"
> and add the required values in the current month's record to that and
[quoted text clipped - 30 lines]
> > > > Thanks,
> > > > Ken
Bob Barnes - 18 Jan 2008 22:38 GMT
How are you storing each month's data?

> That's what I'm after....the code for the VBA loop that will do this for me
> Station by Station.
[quoted text clipped - 33 lines]
> > > > > Thanks,
> > > > > Ken
Larry Daugherty - 18 Jan 2008 04:43 GMT
You *really* don't want to store the running total in each record in
your table.  If you need to display that value, use a query and
calculate and present the figure.  What would happen if you discovered
an error in December that required a correction in January?  All of
the recorded values would then be wrong.

HTH
Signature

-Larry-
--

> Hi, I have a table [Table1] with the fields laid out like this...
>
[quoted text clipped - 11 lines]
> Thanks,
> Ken
KPR - 18 Jan 2008 15:44 GMT
Hi Larry, this is all archived data that will never change. It's a long story
but for system performace through the web these values all need to be
pre-calculated.

Thanks,
Ken

> You *really* don't want to store the running total in each record in
> your table.  If you need to display that value, use a query and
[quoted text clipped - 22 lines]
> > Thanks,
> > Ken
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.