Urgent help required with VB Dates/Mask Edit Control!!! 
Author Message
 Urgent help required with VB Dates/Mask Edit Control!!!

I can't say this technique works for VB4, but it works well for
me in VB3.  I usually just use a plain old text box for date
input and let the user key whatever they want in whatever format
they want.  Then I edit like this:

If Not IsDate((txtTheDate.Text)) Then
    MsgBox "Invalid Date"
    Exit Sub
    'convert to a date type (variant)
    vntNewDate = CVDate((txtTheDate.Text))
    'output as desired format (if necessary)
    txtTheDate.Text = Format$(vntNewDate, "Short Date")
End If

Keep in mind that I just typed the code above in.  I didn't copy
it from a program so there may be some errors.  However, it does
so the technique I use.  The good thing about it is that the user
can key the date anyway they want to.  The IsDate function will
do it's best to decipher a date from it.

Mon, 17 Aug 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Help: Using Masked Edit Control with date format

2. Date fields an Mask Edit control

3. Masked Edit Control and Date

4. Problems with date fields in mask edit controls

5. Masked Edit Control vs. Access 2 Date/TIme

6. Masked Edit Control and Access Date/Time Fields

7. problem with create table and mask edit control's date

8. Masked Edit Control / Dates

9. Using date in Masked Edit Control

10. Using date in mask edit control

11. Masked Edit Control date type problem

12. format date for masked edit control


Powered by phpBB® Forum Software