Datagrid (InvoiceDetail) - How to cal the totalamt

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I got master-detail datatable
in my datagrid (invoicedetail) , I want to (as the user type the unit price
or no of unit), the amount will be caculated and the TOTAL amount can be
update too.

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
Please help~~
 
I find my problem [It seems I need to update the mastertable "InvoiceTable"
first ]
otherwise , I can't sum up the detail tables , Really ??
 
PArt II [I found that I need to update both Tables, so I can sum up the
column]
But it seems not fansy, the user should be input all the information and
check the totalamount
then press "SAVE" and then get the invoice no. How can I do that ??
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

Similar Threads


Back
Top