Solved

Visual Basic Input Mask?

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

740 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