Solved

data format for field

Posted on 2002-04-08
6
155 Views
Last Modified: 2010-05-02
Hello
how can a create fiekd in the form that will accept only data in specified format eg i would like to create field that will accept phone number in xxx-xxx-xxxx format

Thanks,
shri
0
Comment
Question by:shrihalbe
6 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6926344
you should use masked control from microsoft.
0
 

Author Comment

by:shrihalbe
ID: 6926358
can you just explore that how can i used that one
i am really new in this feild.

thanks,
shri
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 30 total points
ID: 6926380
to add a control
menu : project-components -microsoft masked edit control.
drop a control on a form and press f1 for help. this is very simple control to use.


to clear masked control you should use this :

Public Sub ClearMaskEdBox(oMaskEdBox As MaskEdBox)
     Dim sTemp As String
     With oMaskEdBox
          sTemp = .Mask
          .Mask = ""
          .Text = ""
          .Mask = sTemp
     End With
End Sub

'Sample Call:
Private Sub cmdClear_Click()
     ClearMaskEdBox MaskEdBox1
     MaskEdBox1.SetFocus
End Sub
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 45

Expert Comment

by:aikimark
ID: 6926608
please be aware that you might want to explore third-party controls or add code to your masked edit control.  if the user presses the "-" character, they will not be repositioned to the start of the next series of SSN digits.
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 6927120
Its simple,

You can use Mask edit control from microsoft.

Menu : Project- Components - Microsoft masked edit control

Add this code in Form Load -

Private Sub Form_Load()
    With MaskEdBox1
        .MaxLength = 12
        .Mask = "###-###-####"
    End With
End Sub


0
 

Author Comment

by:shrihalbe
ID: 6929593
thanks,
shri
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

777 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