By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

Datagrid (InvoiceDetail) - How to cal the totalamt

P: n/a
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(bmSea InvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
Please help~~
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I find my problem [It seems I need to update the mastertable "InvoiceTable"
first ]
otherwise , I can't sum up the detail tables , Really ??

"Agnes" <ag***@dynamictech.com.hk> 在郵件
news:%2***************@tk2msftngp13.phx.gbl 中撰寫...
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(bmSea InvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
Please help~~

Nov 20 '05 #2

P: n/a
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
"Agnes" <ag***@dynamictech.com.hk> 在郵件
news:%2***************@tk2msftngp13.phx.gbl 中撰寫...
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(bmSea InvInfo.Position)
For Each drInvCharges In drInvInfo.GetChildRows("fk_invno")
decTtlAmt = decTtlAmt + drInvCharges("invamt") <--- it
seems fail
Next
Me.txtTotalAmt.Text = decTtlAmt
Please help~~

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.