Hi!
I have little trouble in my Program. I need to total all the amount in specific column.. comes from the data produced by the datagrid..
heres my code:
Set rs11 = New Recordset
rs11.CursorLoca tion = adUseClient
rs11.Open "Select * From Leave WHERE EmpNo= '" & Txtempno.Text & "'", con, adOpenDynamic, adLockOptimisti c
Set DataGrid1.DataS ource = rs11
Dim i
Dim Total As Double
For i = 0 To DataGrid1.Appro xCount - 1
Total =Total + DataGrid1.Colum ns(15).CellValu e(DataGrid1.Get Bookmark(i))
Next
TXtTotal.Text =Total
my problem is the total amount. example:
Column1
525.25
625.50
Total: 1150.75(which is correct) but it only display like this
Total : 1150 (without a decimal places)
How I can fix this??? Please help me.. tnx..
I have little trouble in my Program. I need to total all the amount in specific column.. comes from the data produced by the datagrid..
heres my code:
Set rs11 = New Recordset
rs11.CursorLoca tion = adUseClient
rs11.Open "Select * From Leave WHERE EmpNo= '" & Txtempno.Text & "'", con, adOpenDynamic, adLockOptimisti c
Set DataGrid1.DataS ource = rs11
Dim i
Dim Total As Double
For i = 0 To DataGrid1.Appro xCount - 1
Total =Total + DataGrid1.Colum ns(15).CellValu e(DataGrid1.Get Bookmark(i))
Next
TXtTotal.Text =Total
my problem is the total amount. example:
Column1
525.25
625.50
Total: 1150.75(which is correct) but it only display like this
Total : 1150 (without a decimal places)
How I can fix this??? Please help me.. tnx..
Comment