Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Nov 2006
    Location
    Phoenix, Arizona, USA
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date field in form (2003/11.5614.8122)

    My data-entry form has separate boxes for Month, Day, and Year, followed by a separate box for the Date (xx/xx/xxxx). I'd like to just enter the first three boxes and have Access automatically generate the Date. I'm not quite sure how to do this. Do I create a calculated control in the Date box? If so, what commands (expressions?) do I use?

    Alternatively, is it possible to enter only the Date and have Access split that up into month, day, year and put the information automatically into the first three boxes?

    Thanks.

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

    Re: Date field in form (2003/11.5614.8122)

    1) Set the Control Source property of the Date text box to

    =DateSerial([Year],[Month],[Day])

    2) Set the Control Source for the Day, Month and Year text boxes to

    =Day([Date])

    =Month([Date])

    =Year([Date])

  3. #3
    Star Lounger
    Join Date
    Nov 2006
    Location
    Phoenix, Arizona, USA
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date field in form (2003/11.5614.8122)

    Not sure what's wrong, but I get "#Error" in all four boxes after entering the properties below. I made the changes in Design View in the Form window -- was that correct?
    Hmmm.

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

    Re: Date field in form (2003/11.5614.8122)

    You cannot use all of them at the same time, that leads to a vicious circle. I had clearly distinguished two cases. Use either one or the other.

  5. #5
    Star Lounger
    Join Date
    Nov 2006
    Location
    Phoenix, Arizona, USA
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Date field in form (2003/11.5614.8122)

    Thanks Hans. I hadn't realized the two were mutually exclusive. Now that you point it out, I can see why.

    Thanks for the help.

Posting Permissions

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