Solved

Visual Basic Input Mask?

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

760 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

16 Experts available now in Live!

Get 1:1 Help Now