Solved

MaskEdBox - using with a custom mask

Posted on 2000-03-02
6
439 Views
Last Modified: 2013-12-26
Looking for an example of how to check data input of the "Canadian Postal Code" using this control.
0
Comment
Question by:trudymaresch
  • 3
  • 3
6 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2578595
Set the Mask property to: >?#? #?#
0
 

Author Comment

by:trudymaresch
ID: 2580729
Emoreau thanks for responding... Tried this mask.

ON lost focus event with "country" (the previous field) the maskedbox becomes visible and gets focus if the country=Canada.  I can type anything in the maskedbox1 and it will except it.  Isn't it supposed to check the format when entering in the data?  Does the maskedbox control have to be bound to an data control for it to work?

These are probably more than you wanted to answer.....

0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 2580984
Are you setting the Format or the Mask property?

The mask property is for inputting while the format property is for displaying.

Here is a code sample that works for me:
Private Sub Text1_LostFocus()
    If UCase$(Trim$(Text1.Text)) = "CANADA" Then
        MaskEdBox1.Visible = True
        MaskEdBox1.Mask = ">?#? #?#"
        MaskEdBox1.SetFocus
    Else
        MaskEdBox1.Visible = False
    End If
End Sub
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 69

Expert Comment

by:Éric Moreau
ID: 2587388
Is it working for you now?
0
 

Author Comment

by:trudymaresch
ID: 2588825
Hi Emoreau,  I will be working on that project Thursday to make the change and I will let you know.  Its look good, but I have to try it where the project is located.  If you want to post you comment as the answer please do so.  If I have any other problems I will comment further on your answer.
0
 

Author Comment

by:trudymaresch
ID: 2602452
Thanks emoreau, your code worked wonderfully!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now