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

Answer to placing values in a field in Tab A from Tab B

P: n/a
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


Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Woody,

I suggested that

|| You say you set the TextBox value. Some last questions
||
|| Are you expecting the DataSource to update? Is it doing so?
|| If not, can you set the DataSource directly? If you do, does
|| your TextBox now display the correct value?

And so did Peter Huang.

|| I think you can work around the problem by change the value
|| of the dataset directly.
|| Private Sub Button1_Click(...) Handles Button1.Click
|| 'TextBox1.Text = "ee"
|| DataSet11.Tables(0).Rows(0)(0) = "ee"
|| End Sub

;-)

Regards,
Fergus
Nov 20 '05 #2

P: n/a
Fergus

Thank you for your help and interest. I am unable to find your suggestion
though I don't doubt you made it.

I did find Peter's suggestion. It was posted yesterday (Sunday) and I did
not see it today untill you brought it to my attention.

I do try to read the responses carefully. Thank you again to you and all
who try to assist.

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.