Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Red face Unanswered: How to change the date format?

    Hi all

    I want to change the date format as dd-mm-yy in the input text box which is placed on a form.
    But I don't know how to.
    Pls. let me know that I can change it or not.

    Thanks all.

    mmlatt
    Last edited by mmlatt; 02-17-04 at 00:45.

  2. #2
    Join Date
    Feb 2004
    Location
    Binary Universe
    Posts
    57
    You can change it in Windows Control Panel in 'Regional And Language Options' or it's equivalent.
    I won't byte... hard!

  3. #3
    Join Date
    Feb 2004
    Posts
    37
    textbox?

    try in input mask
    99-99-00;0;_
    and in format
    dd-mm-yy

  4. #4
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Thumbs up Thanks You Very Much

    Woooo.... Nice soluction!

    How stupid I'm, I never try to type mm-dd-yy in the format field.

    Thanks brianb99999 and The Byte

    mmlatt

  5. #5
    Join Date
    Feb 2004
    Location
    Binary Universe
    Posts
    57
    I wouldn't use input masks on Date text boxes. In form's design view, double click on your text box for a date, on 'Format' tab's top line select 'Short/Long date'. If you change the date format to 'dd-mm-yy' in Window's control panel this enables a user to just type '17 2' and after control looses focus access converts it to '17-02-04'.
    I won't byte... hard!

  6. #6
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Smile Thanks again

    The Byte

    Thanks for your suggestion.
    I try to use brianb99999's suggestion and seen OK, but the problem is that before I do not change the Windows setting Access converts input data to mm-dd-yy formatwhen the control looses focus .

    The best way to input as dd-mm-yy is control by code, Right?
    I can make some changes of the Windows on my system only.
    So I should write some code to allow to input dd-mm-yy in the text box run on any system.

    Pls. check this code for any correction or enhancement.

    Public Function DateCvt(strDateText As String) As String

    Dim flag As Integer
    Dim intLength As Integer
    Dim intSeparator As Integer
    Dim strDD As String
    Dim strMM As String
    Dim strYY As String

    intLength = Len(strDateText)
    intSeparator = 0

    For flag = 1 To intLength
    If Mid(strDateText, flag, 1) <> "/" Then
    Select Case intSeparator
    Case 0:
    strDD = strDD & Mid(strDateText, flag, 1)
    Case 1:
    strMM = strMM & Mid(strDateText, flag, 1)
    Case 2:
    strYY = strYY & Mid(strDateText, flag, 1)
    End Select
    Else: intSeparator = intSeparator + 1
    End If
    Next flag

    DateCvt = strMM & "/" & strDD & "/" & strYY

    End Function

    Regard
    mmlatt

  7. #7
    Join Date
    Feb 2004
    Location
    Binary Universe
    Posts
    57
    So, your situation is:
    You want to display dates in text controls 'dd-mm-yy' on any computer even if the control panel setting is 'mm-dd-yy' by using this function?
    I won't byte... hard!

  8. #8
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42
    Originally posted by The Byte
    So, your situation is:
    You want to display dates in text controls 'dd-mm-yy' on any computer even if the control panel setting is 'mm-dd-yy' by using this function?
    Exactly!
    That's what I need to do.

Posting Permissions

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