Results 1 to 2 of 2

Thread: changing

  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I have a form that has a check box called midyear, and another text box call lastday, and a list box called fmyear populated with the values of 2007, 2008, 2009 etc.
    The default value of the lastday = DateSerial([fmyear],12,31).

    What I would like to do is have lastday change to juin 30th (DateSerial([fmyear],06,30)) when the midyear check box is clicked otherwise default value is the 31th of December DateSerial([fmyear],12,31), should be returned.

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

    =DateSerial([fmyear], 13+6*[midyear], 0)

    If midyear is clear, 6*[midyear] is 0, so the formula returns the 0th day of the 13th month, i.e. the last day of the 12th month.
    If midyear is ticked, 6*[midyear] is -6, so the formula returns the 0th day of the 7th month (13 + -6 = 7), i.e. the last day of the 6th month.

Posting Permissions

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