?
Solved

Visual Basic Input Mask?

Posted on 2004-04-12
5
Medium Priority
?
2,493 Views
Last Modified: 2013-12-26
How do I create a date input mask in Visual Basic 6.  I want the text field to be formatted just like MS Access's Input box Function.  I want to be able to display a short date in the text field.  If I haven't been clear, create a form in MS Access and add one field.  Format that field date/time, select input box from the general procedure, select short date.  I need to see something like this!
##/##/####......I just want the end users to be able to enter the numbers not the slashes.

0
Comment
Question by:spzbiegien
[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
5 Comments
 
LVL 9

Expert Comment

by:dancebert
ID: 10809358
Have you checked out VB's Masked Edit control?
0
 
LVL 11

Accepted Solution

by:
bingie earned 1200 total points
ID: 10809371
Try this,

Add the Microsoft Masked Edit Control under Components (CTRL + T)

Then add this:

Private Sub Form_Load()
 MaskEdBox1.Mask = "##/##/####"
End Sub

Bingie
0
 
LVL 13

Expert Comment

by:Michael_D
ID: 10813248
There is better control to input and display date: DTPicker.
Try it !
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10839812
I also vote for the DTPicker control

To get this control, click on Project -> Component
Check the box next to Microsoft Windows Common Controls -2
0
 

Expert Comment

by:pwappdev
ID: 11010031
Hey bingie,

I see that you already accepted a solution to your posted issue.

However, as I'm sure you know, and understand, the components Tab points back to COM objects.  

If you want a true .net assembly you might want to take a look at
Ted Schopenhouer's freeware on the codeproject.com website, which allows you to build your own assembly (Control) based on his initial source.

I've taken a look at it, and that's the route we're taking.

http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp

Best wishes and good luck!

pwAppDev
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

764 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