Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi all,

    I have a template with an opening dialog box that uses the date picker feature which displays a calendar. When the user selects a date from the calendar and the OK button is clicked, a bookmark in the document fills with the selected date. The default date format seems to be m/d/yyyy (1/2/2009), for example.

    How and where do I reformat the DTPicker so the document's date displays January 2, 2009, for example? Here's the DTPicker code which inserts the date format described in first paragraph. Or, do I reformat the document's bookmark? If so, how?

    Thanks,
    Charlie
    charlie6067

    Public Sub DTPicker1_CallbackKeyDown(ByVal KeyCode As Integer, ByVal Shift As Integer, ByVal CallbackField As String, CallbackDate As Date)

    dtEffDate = Format(DTPicker1.Value, "MMMM d, YYYY")

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I wouldn't use the CallbackKeyDown event of the datye/time picker, but the Change event:

    Code:
    Private Sub DTPicker1_Change()
      ActiveDocument.Bookmarks("SomeBookmark").Range.Text = _
    	Format(Me.DTPicker1.Value, "MMMM d, YYYY")
    End Sub

  3. #3
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Slinky, for the reply. Your suggestion worked great.

    Charlie
    charlie6067

Posting Permissions

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