Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding to a date (2000)

    I have a text box(txtDate) with control source =Day([txtstartdate]+363). txtStartDate is unbound with default value DateValue("12/27/04"). I want to add 1 to txtDate in an onclick event of btnInc. In the onclick, I currently have me.txtNewBox = me.txtDate + 1. I need this value to show up as mm/dd/yy, instead it only shows up dd. How do I change that?

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

    Re: Adding to a date (2000)

    Have you set the Format property of txtNewBox to a proper date format?

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Evansville, Indiana, USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding to a date (2000)

    I set it to Short Date and when it peforms the calc, it returns 1/25/1900.

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

    Re: Adding to a date (2000)

    Oh wait, txtDate does not contain a date, since you used the Day function in its control source. You should set the Control Source of txtDate to

    =[txtstartdate]+363

    and set the Format property of this text box to d or dd. Then, txtNewDate should work OK.

Posting Permissions

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