Results 1 to 3 of 3

Thread: [RESOLVED]Date Format

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Resolved [RESOLVED]Date Format

    I am using VB 6.0 and I am having trouble formating dates that are keyed into the textboxes.

    I'm using the code in a LostFocus event so the date will format once the user clicks outside the textbox. Here is my code.

    VB Code:
    1. txtEmployee(Index) = Format(txtEmployee(Index), "mm/dd/yyyy")

    Once the textbox loses focus the date changes to some weird date that was not the one originally keyed into the textbox.
    Last edited by lilmark; Apr 24th, 2006 at 02:31 PM.

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Date Format

    what is being Keyed in and what is coming out?
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    367

    Re: Date Format

    Nevermind, I found out what was wrong.

    If I enter the date 013180 the date would format and show an incorrect date. You need to enter the date as 01/31/80 so it'll format to 01/31/1980

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