Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

input mask from VBA

Posted on 2016-09-22
4
Medium Priority
?
21 Views
Last Modified: 2016-09-22
Hello I am trying to figure out how to do an input mask in vba,

me.txtzip= 00000;0
0
Comment
Question by:Ernest Grogg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 41811477
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.
0
 

Author Comment

by:Ernest Grogg
ID: 41811481
I do do that...

so an if/then statement won't work?
0
 

Author Comment

by:Ernest Grogg
ID: 41811527
it does seem to work using the if/then on another field for after update event..

thanks
0
 
LVL 39

Expert Comment

by:PatHartman
ID: 41811611
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.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question