input mask from VBA

Ernest Grogg
Ernest Grogg used Ask the Experts™
on
Hello I am trying to figure out how to do an input mask in vba,

me.txtzip= 00000;0
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
You have to reference the property name to set it.  And you probably have to enclose the string in quotes.

Try

me.txtzip.InputMask = " 00000;0"

Keep in mind that if you distribute as an .accde or .mde, you CANNOT make changes to forms or reports on the fly like this.
Ernest GroggSecurity Management InfoSec

Author

Commented:
I do do that...

so an if/then statement won't work?
Ernest GroggSecurity Management InfoSec

Author

Commented:
it does seem to work using the if/then on another field for after update event..

thanks
Distinguished Expert 2017

Commented:
Form/Control properties fall into two categories.  Some can be set and saved without putting the form into design view and others cannot.  This property must be in the first category if it works in an .accde.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial