Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Word 2003

    I have two DTPickers in a form.

    For the first one, I'd like to have it default to the first of the following month.
    For the second one, I'd like it to default to the first of the month but a few months later.

    Example: Form opens today Dec 17th. DTPicker1.value = 01/01/2010
    DTPicker2.value = 04/01/2010


    Here's the current code used with my crude attempt to set dates. What does the code need to display the above default dates?

    Private Sub UserForm_Activate()

    DTPicker1.Value = Date
    DTPicker2.Value = Date + 90

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try this:

    DTPicker1.Value = DateSerial(Year(Date), Month(Date) + 1, 1)
    DTPicker2.Value = DateSerial(Year(Date), Month(Date) + 4, 1)

  3. #3
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As always, thank you Hans for your quick replies and help. I really appreciate your contribution to these forums.

    Merry Christmas and Happy Holidays!
    Charlie
    charlie6067

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Thank you, and best wishes to you too!

Posting Permissions

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