W
Woody Splawn
Last week there was a rather long exchange on this newsgroup titled Why this
no work" I will delineate the solution below. It is simple. I don't know
why someone else didn't suggest it. Oh well <g>. Instead of trying to
update the field in the usual way you have to update the datatable instead.
To restate the problem. I had a Winform with a tab on it. I had code in a
button on tabA that updated a field in tab A. I could put similar code in a
button on TabB (to update the the field in Tab A) but it would not work.
Same code, the only difference was that the code was being called from a
different tab. The code did work if the fields were not bound but in my
case the fields are bound. The solution to how to make the field in TabA
get updated with the proper value is to not try to do it with code like
this:
'Me.txtBalDue.Value = 4
But rather with code like this:
Dim Dt As DataTable
Dt = DsMain1.Tables("Contracts")
Dt.Rows(0)("BalDue") = 4
no work" I will delineate the solution below. It is simple. I don't know
why someone else didn't suggest it. Oh well <g>. Instead of trying to
update the field in the usual way you have to update the datatable instead.
To restate the problem. I had a Winform with a tab on it. I had code in a
button on tabA that updated a field in tab A. I could put similar code in a
button on TabB (to update the the field in Tab A) but it would not work.
Same code, the only difference was that the code was being called from a
different tab. The code did work if the fields were not bound but in my
case the fields are bound. The solution to how to make the field in TabA
get updated with the proper value is to not try to do it with code like
this:
'Me.txtBalDue.Value = 4
But rather with code like this:
Dim Dt As DataTable
Dt = DsMain1.Tables("Contracts")
Dt.Rows(0)("BalDue") = 4