Master-Detail Datagrid sum up problem

A

Agnes

I got master-detail datagrid
in my datagrid (invoicedetail) , aim(as the user type the unit price or no
of unit), the amount will be calculated and the TOTAL amount can be showed
in the form at once.

In my columnchanged event
e.Row("invamt") = e.Row("unitprice") * e.Row("noofunit") *
e.Row("exrate")
drInvInfo =
Me.dsSeaInvInfo.Tables("invoiceHeader").Rows(bmSeaInvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
How can I sum up the detail tables before I update the tables ??
Thanks
 
K

Ken Tucker [MVP]

Hi,

Try this.

decTtlAmt = decTtlAmt + Cdec(drInvCharges("invamt"))

Ken
---------------

I got master-detail datagrid
in my datagrid (invoicedetail) , aim(as the user type the unit price or no
of unit), the amount will be calculated and the TOTAL amount can be showed
in the form at once.

In my columnchanged event
e.Row("invamt") = e.Row("unitprice") * e.Row("noofunit") *
e.Row("exrate")
drInvInfo =
Me.dsSeaInvInfo.Tables("invoiceHeader").Rows(bmSeaInvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
How can I sum up the detail tables before I update the tables ??
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top