Solved

Visual Basic Input Mask?

Posted on 2004-04-12
5
2,485 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 300 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Interview questions for support of a legacy ASP.NET site 4 72
Windows ICD FFU Issue 4 89
Set WorkSheet  not Working 9 51
Developing a front end to SPLUNK 1 54
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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