Solved

input mask from VBA

Posted on 2016-09-22
4
20 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 38

Accepted Solution

by:
PatHartman earned 500 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 38

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

615 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