XL5/VBA: Validating dialog input box-by-box?

XL5/VBA: Validating dialog input box-by-box?

Post by John Streete » Wed, 11 Sep 1996 04:00:00



Is there a way to validate edit-box entries in a custom
dialog box on a box-by-box basis -- that is, when users
tab out of each box -- rather than when the users hit "OK"
to exit the dialog itself?

My dialog now launches a validation routine when users
hit "OK" to continue -- if the input's clean, it moves
along; if the input requires correction it reopens the
dialog and prompts for corrected entries.

I would much prefer to trap and notify as soon as users
hit TAB to move out of each edit box.  The validation
is tricky -- I can't use the built in validation features
for this, and I'm not sure that those trigger on TAB
either. . . .

Any pointers?

Thanks

John Streeter

 
 
 

XL5/VBA: Validating dialog input box-by-box?

Post by Bert Broekhui » Fri, 13 Sep 1996 04:00:00



> Is there a way to validate edit-box entries in a custom
> dialog box on a box-by-box basis -- that is, when users
> tab out of each box -- rather than when the users hit "OK"
> to exit the dialog itself?

> Any pointers?

> Thanks

> John Streeter

Hi John,

You can evaluate entered values by assigning a macro to the editbox or other dialogbox-
object. By asigning itthe macro will for instance start when the value in the editbox is changed.

In the macro you 'll have to check if the value meets its required values. if not have a msgbox appear.

The way you can assign a macro is by rightclicking on the object in the dialogbox designsheet and
choosing "Assign Macro" from the list. You can now make a new macro.

Good luck.

Edwin Witjens
Broekhuis Training
Rotterdam
The Netherlands