Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Increment Date Field? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    How do I use event code to increment/decrement a date field in a unbound form?

    Thanks, John

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Increment Date Field? (a2k (9.0.6926) SP-3 Jet 4.0 SP-7)

    John
    It depends what you want to do.
    if you just want to increment as a single action, ie press a button:

    Me.txtDate = Date + 1
    or
    Me.txtDate = Date - 1

    If you are talking of showing many rows of incremented dates, then you'll need an array.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: How to Increment Date Field? (a2k (9.0.6926) S

    I think you meant:

    Me.txtDate = me.txtDate + 1
    or
    Me.txtDate = me.txtDate - 1

    The way you wrote it it will set txtDate to be one day after/before today's date.
    Regards
    John



  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to Increment Date Field? (a2k (9.0.6926) S

    Yes John, I stand corrected, a litle oversight I think.

    Thanks

Posting Permissions

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