Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MaskEdBox - using with a custom mask

Posted on 2000-03-02
6
Medium Priority
?
472 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 70

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 70

Accepted Solution

by:
Éric Moreau earned 400 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

971 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