View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Data validation on form

I think you added something to disable that button. (I was just using it as a
cancel button--and it was always enabled for me.)

But I do get your point. It's a nice way to make sure entries are valid before
continuing.

Norman Jones wrote:

Hi Dave,

Actually, the button was only there to close the form. I didn't put any
code in there to enable/disable it.

(and maybe it's no longer so subtle, huh?)


Nevertheless, the fact that the button is inoperable (even without explicit
code) if an invalid entry is made in the textbox seemed to me a very
pleasing way of underlining your validation code.

---
Regards,
Norman

"Dave Peterson" wrote in message
...
Actually, the button was only there to close the form. I didn't put any
code in
there to enable/disable it.

(and maybe it's no longer so subtle, huh?)

Norman Jones wrote:

Hi Sneagle

Thanks...way too tired now to try it, but why the first lines...option
explicit and Unload me?

Adding the Option Explicit statement at the top of a code module ensures
that all variables have to be explicitly declared. This represents good
programming practice. For more information on the use of Option Explicit
and
the declaration of variables, see Chip Peareson at:

http://www.cpearson.com/excel/variables.htm

Dave added the statement at the head of his code as a subtle way of
advocating its universal use.

By adding the command button code, Dave provides a convenient way of
demonstrating his suggested validation code: the button can only be used
to
close the form if the validation conditions are satisfied.

---
Regards,
Norman


--

Dave Peterson