PC Review


Reply
Thread Tools Rate Thread

Bound textbox not filled if tabPage has not been viewed

 
 
Tom
Guest
Posts: n/a
 
      15th Jul 2004
I have a form with a tabControl with 6 tabPages. There are
textBoxes on all the tabPages that are bound to a dataset.
The user can click a modify button, edit whatever
textBoxes they want and then click an OK button. The OK
button handler loops over all the textBoxes on all the
tabPages to validate their contents.
The problem is that the textBoxes on any tabPage which has
not been viewed appear empty to the code. It appears that
VB does not fill in bound textBoxes until the tabPage is
viewed (the tab clicked on by the user). Hence my
validation code thinks these textBoxes .text properties
are null and complains. I have kludged around this by
having the validation code select each tabPage in turn.
This works, but the user sees all the various tabPages
rapidly exposed after they hit the OK button.
Is there a better solution?
Thanks
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Jul 2004
Hi Tom,

It appears that
VB does not fill in bound textBoxes until the tabPage is
viewed (the tab clicked on by the user).

Right, do not use the value in the textbox however the underlaying data.

I hope this helps?

Cor


 
Reply With Quote
 
Tom
Guest
Posts: n/a
 
      16th Jul 2004
It confirms what I suspected.
Most, but not all of the textboxes are bound to columns in
a dataset. I presently loop over all the controls as a
convenient way to do the validation. It avoids having a
bit of specific code for each column.
Is there an easy way using only the information from the
textbox object (including the binding information) to get
the value of the underlying data? If so then I could
manage to make this work without a major architectural
change.

thanks
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Jul 2004
Hi Tom,

Show some code how you fill your textbox (probably bound it), than I try to
tell you how you get your information from the source, mostly that needs
less (more unified) code.

Cor

> It confirms what I suspected.
> Most, but not all of the textboxes are bound to columns in
> a dataset. I presently loop over all the controls as a
> convenient way to do the validation. It avoids having a
> bit of specific code for each column.
> Is there an easy way using only the information from the
> textbox object (including the binding information) to get
> the value of the underlying data? If so then I could
> manage to make this work without a major architectural
> change.
>
> thanks



 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      5th Aug 2004
Dear Tom,
Can you solve the problem now ????
I got this same problem also, but I can't seek any solution

From agnes
"Tom" <(E-Mail Removed)> ???
news:2e21701c46a80$2a08e280$(E-Mail Removed) ???...
> I have a form with a tabControl with 6 tabPages. There are
> textBoxes on all the tabPages that are bound to a dataset.
> The user can click a modify button, edit whatever
> textBoxes they want and then click an OK button. The OK
> button handler loops over all the textBoxes on all the
> tabPages to validate their contents.
> The problem is that the textBoxes on any tabPage which has
> not been viewed appear empty to the code. It appears that
> VB does not fill in bound textBoxes until the tabPage is
> viewed (the tab clicked on by the user). Hence my
> validation code thinks these textBoxes .text properties
> are null and complains. I have kludged around this by
> having the validation code select each tabPage in turn.
> This works, but the user sees all the various tabPages
> rapidly exposed after they hit the OK button.
> Is there a better solution?
> Thanks



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox focus on tabpage? explode Microsoft VB .NET 1 8th Feb 2007 01:43 AM
textbox events when date is filled in a textbox with calendar pop- =?Utf-8?B?U3JpZGhhcg==?= Microsoft ASP .NET 1 14th Feb 2006 02:50 PM
Databinding Textbox on TabPage =?Utf-8?B?TWFydGluIEdyb2Js?= Microsoft Dot NET Framework Forms 1 8th Feb 2006 11:11 AM
Textbox Bug? Missing/delayed update of textbox filled via VBA =?Utf-8?B?TWFyY00=?= Microsoft Excel Programming 0 4th Nov 2004 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA =?Utf-8?B?TWFyY00=?= Microsoft Excel Programming 0 4th Nov 2004 05:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 AM.