Results 1 to 3 of 3

Thread: how to validate text box imput -- date only!

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Philippines
    Posts
    49

    Question

    ok. my next prob is what if i want that my text box accepts date formats only?

  2. #2
    Guest
    Use the IsDate function.

    Code:
    Private Sub Command1_Click()
    If IsDate(Text1.Text) Then
    MsgBox "Date correct"
    Else
    MsgBox "Invalid date!"
    End If
    End Sub

  3. #3
    New Member
    Join Date
    Oct 2000
    Posts
    3

    Talking

    you may want to put the IsDate function in the validate event.

    OR- You can implement a filter on the text box when it becomes active, youcan filter out all letters, etc.

    Also, you can use the mask edit text box control which allows you to put an input mask on the text box like when the box becomes active **/**/****.

    This is an active x control and is behaves weirdly, you'll have to add code to handle possible errors.

    Hope this helps!!
    Curry :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width