A
Agnes
From the help menu, I know that I can use myTable.compute the get the sum
amount.
Now myDatagrid 's datamember is myTable, I put the following code in my
datagrid.currentcellchanged.
and I found a little problem , As the user input the total in the 1st row,
and press 'tab' to another column .
It can't sum up the 1strow 's total, If I input the data in the 2nd row and
pres s'tab' , It will sum the 1st row but not 1st row & 2ndrow.
If I move to the 3rd row, it will sum up both 1st row 2ndrow.
anybody got idea ? Thanks a lot
Private Sub ComputeBySalesSalesID(ByVal myDataSet As DataSet)
Dim myTable As DataTable
myTable = myDataSet.Tables("Orders")
Dim objSum As Object
objSum = myTable.Compute("Sum(Total)", "EmpID = myID")
End Sub
amount.
Now myDatagrid 's datamember is myTable, I put the following code in my
datagrid.currentcellchanged.
and I found a little problem , As the user input the total in the 1st row,
and press 'tab' to another column .
It can't sum up the 1strow 's total, If I input the data in the 2nd row and
pres s'tab' , It will sum the 1st row but not 1st row & 2ndrow.
If I move to the 3rd row, it will sum up both 1st row 2ndrow.
anybody got idea ? Thanks a lot
Private Sub ComputeBySalesSalesID(ByVal myDataSet As DataSet)
Dim myTable As DataTable
myTable = myDataSet.Tables("Orders")
Dim objSum As Object
objSum = myTable.Compute("Sum(Total)", "EmpID = myID")
End Sub