I'm sorry, I didn't read the question carefully enough. There are two ways
to do this.
You CAN use the DSum -- IF you save the SQL Statement that fills the
RowSource of the listbox as a saved query. Then you can use it like this:
curCheckReqTotal = DSum("CheckAmt", "DSumTestQuery")
Note: Since you didn't provide table and field names, I created my own. In
this case, CheckAmt is the field that fills Column(7) and DSumTestQuery is
the RowSource for the Listbox saved as a query.
Another option is to loop through the listbox itself (as opposed to going to
the base table) for the information. You can do that with the following
code:
Dim i As Integer
Dim curCheckReqTotal As Single
curCheckReqTotal = 0
For i = 0 To lstboxCheckRequest.ListCount - 1
curCheckReqTotal = curCheckReqTotal + lstboxCheckRequest.Column(7, i)
Next i
Hope that helps.
--
--Roger Carlson
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L