We help IT Professionals succeed at work.

input mask from VBA

Ernest Grogg
Ernest Grogg asked
on
Hello I am trying to figure out how to do an input mask in vba,

me.txtzip= 00000;0
Comment
Watch Question

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.