Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Best way to adjust for Leep Year (2002)

    Hi!

    I've got a form that has [txtStartDate] and [txtEndDate] that the user enters the date range for the report. I have to fields that are not visible to the user that are called [txtPreviousStartDate] and [txtPreviousEndDate]. The code behind the command is

    Me.txtPreviousEnddate.Value = Me.txtEndDate

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

    Re: Best way to adjust for Leep Year (2002)

    Use the DateAdd function:

    Me.txtPreviousEndDate = DateAdd("yyyy", -1, Me.txtEndDate)

    If you click in DateAdd (in the Visual Basic Editor) and press F1, you'll get the online help for this function.

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Best way to adjust for Leep Year (2002)

    Thanks Hans!

Posting Permissions

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