Listbox Sum Values

kostaskir

Registered User.
Local time
Today, 04:22
Joined
Jan 21, 2009
Messages
65
Hello guys,

I have a listbox with 6 columns.
Tha last 3 columns are Hours, Minutes & Seconds.

I have three other edit boxes (Total Hours, Total Minutes & Total Seconds.)
where I want to summarize the column data.

Do you know how ? :D
 
The rowsource of the listbox will be either a table or a query, whichever it is use this as the base for your calculations. It all depends on how you want to display the results.

If you want it to read x days y hours and z minutes then you need to calculate them in reverse order so you can add the converted minutes into hours and converted hours in to days.

David
 
So through VBA, I guess I have to ...

Dim sqlselect As String

sqlstring = SELECT Sum(Tracks.[Hours]) AS SumOfHours
FROM Tracks
WHERE (((Tracks.CDID)=[Forms]![CD]![CDID]));

DoCmd.RunSQL sqlstring

And to pass the result on the edit box

Me.EditBox = ???


The way I am thinking is correct ?


I know the query is correct BUT the syntax in VBA should be different. And I don't know how to convert it as well.


Thank you in advance !
 

Users who are viewing this thread

Back
Top Bottom