serious expertise needed updating recordsets with SQL

Pete64

Registered User.
Local time
Today, 00:06
Joined
Jul 1, 2003
Messages
37
I need HELP! O(o_o)O
---------------------------

I am suriously stuck, Debugging code without documentation is a nightmare for trainee programmers.

Basically I need to loop a record set called Summary and Validate all informtion containned within it, I assume the way I can accomplish the task but am not sure how to implement it, right next within the loop I have to grab a value from a field called Carried Forward in that record and then set the value of Balance C/F in the next record to the grabbed Carried Foward Value from the previous record.

But this can apply to only certain records for example within my ContractorID field in the table it relates to multiple instances of certain contractors, the first instance of a contractor will contain no Balance C/F and the last instance may contain a Carried Forward value but I don't want to grab the last value because it would wreck the other records.

I think I have to create some kind of SQL statement an APPEND query but don't have the expertise. HELP ME please..

Any ideas would be nice, And also tell me if you want me to explain more, can you guys understand me?
 
There are lots of examples of running sums here in the archives. Most of them will also tell you that storing calculated values is ill advised.
 
why?

can u tell me why??
is there an alternative to what I am trying to do???

please help i am desperate
; )

I mean this is not a calculated SUM, the value is stored in a field in a table and then it will be used in a report.

I've heard its ill advised to store calculated fields in tables but I am asking for help in making up a statement or any view points on what I am trying to achieve.
 
Last edited:
this is what I have done so far if anyone is interested?

OK this is how far I've gottin its slow but it does grab the value of [C/F] and then places it in [Balance C/F] in the next record.

Anyone am I on the right path, I think theres a more effecient method in SQL but I dont know how to implement it.

Private Sub Command60_Click()

Dim RS As DAO.Recordset
Dim temp As Double
Dim lp As Integer
Dim rf As Double

Set RS = Me.RecordsetClone

RS.MoveFirst
temp = RS![C/F]
RS.MoveNext
While Not RS.EOF
RS.Edit
RS![BalanceC/F] = temp
temp = RS![C/F]
RS.UPDATE
RS.MoveNext
Wend
Set RS = Nothing

End Sub
 
As Pat has already stated storing RunningSums in Access is not recommended, search here for RunningSum
 
I am asking for advise Isn't this a forum

what is your problem, can't you help me or what!
 
I've checked

I searched and found nothing that was related to what I want to accomplish. Is my first post clear in what I am trying to do?
 

Users who are viewing this thread

Back
Top Bottom