Hi,
I have a form with several text boxes on it.
Each test box requires some validation ... for being numeric etc.
and I am successfully using the Validating and Validated events of each
text box and an ErrorProvider to achieve this...

However, I want to validate one of the text boxes such that the user
*must* enter a value... ie. the text box must be non-blank.
I tried putting code in the Validating event to disallow a blank
value.. this did not work.
The problem is that the Validating event is only invoked if the text
box gets focus. If the user never clicks on the text box, then me error
is never displayed.

How do I force this validation .. even if text box never gains focus ?

Many thanks.

Re: Text Box Validation - prevent a blank entry by Nelson

Nelson
Tue Oct 18 03:27:42 CDT 2005

Hello

I don't know what are you trying to do but why don't you validate if the
textbox is blank when the user make the finnal action.
Something like before send the data to the database

"ecurb" <bruce.forbes@paradise.net.nz> wrote in message
news:1129585753.987710.41240@g14g2000cwa.googlegroups.com...
> Hi,
> I have a form with several text boxes on it.
> Each test box requires some validation ... for being numeric etc.
> and I am successfully using the Validating and Validated events of each
> text box and an ErrorProvider to achieve this...
>
> However, I want to validate one of the text boxes such that the user
> *must* enter a value... ie. the text box must be non-blank.
> I tried putting code in the Validating event to disallow a blank
> value.. this did not work.
> The problem is that the Validating event is only invoked if the text
> box gets focus. If the user never clicks on the text box, then me error
> is never displayed.
>
> How do I force this validation .. even if text box never gains focus ?
>
> Many thanks.
>