Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the currency total of a column in a flexgrid?? 1

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
How would you go about getting the total(currency) of a column in a MSHFlexGrid?? Every day above ground is a GOOD DAY!!!
 
Here is a rudimentary sample. Hopefully you can piggyback off this sample to come up with a useful solution.

Dim tot1 As Currency
Dim tot2 As Currency

grid.AddItem 100 & vbTab & 200
grid.AddItem 150 & vbTab & 250
grid.AddItem 200 & vbTab & 100
grid.AddItem "hello" & vbTab & ""
grid.rows = 0

For jloop = 0 To grid.Rows - 1
grid.Row = jloop
grid.Col = 0
If grid.Text > " " And Val(grid.Text) > 0 Then tot1 = tot1 + CCur(grid.Text)
grid.Col = 1
If grid.Text > " " And Val(grid.Text) > 0 Then tot2 = tot2 + CCur(grid.Text)
Next jloop

MsgBox tot1 & " total1 and total2 " & tot2
 
Actually, the column in question already has a value(dollar amount) and I just need to add the total together. I'll print that though and see if I can apply it. Thanks
Every day above ground is a GOOD DAY!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top