Consulting

Results 1 to 3 of 3

Thread: User Form & Calendar

  1. #1
    VBAX Regular
    Joined
    Nov 2008
    Posts
    53
    Location

    User Form & Calendar

    I have this code below that is great and drops the chosen date from a popup Calendar into the TextBox on my form. My only problem is that it show in an American format how can I change it so that its showing as "dd-mmm-yy"?

    Option Explicit
    
    Private Sub Calendar1_DblClick()
    usrfrmReport.txtFormDate = usrFrmCalendar.Calendar1.Value
    Unload Me
    End Sub
    Private Sub UserForm_Initialize()
    'Change the Calendar date to todays date
    usrFrmCalendar.Calendar1.Value = Date
    End Sub

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I don't get that problem, but you could try

    [vba]

    usrfrmReport.txtFormDate = Format(usrFrmCalendar.Calendar1.Value, "dd-mmm-yy")
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Nov 2008
    Posts
    53
    Location
    Thanks for that it works now

Posting Permissions

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