Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combos for Dates (Access2003 SP2)

    I am setting up a database with lots of dates and I need to have three combos for each date field to facilitate data entry, that is, one combo each for day, month, and year. The Record Source for each combo comes from either a table of days (1 to 31), a table of months (Jan-Dec), or a table of years (1920-2007). A simple DateSerial code compiles the data from the three combos to form the actual date and that part works perfectly.

    The problem is that when I start using any combo whether the day, month, or year, the next record gets populated with the same data.

    As always, any assistance is greatly appreciated.

    Thanks

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

    Re: Combos for Dates (Access2003 SP2)

    Can you provide some details, for example about the code behind the combo boxes?

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combos for Dates (Access2003 SP2)

    Thanks Hans

    There are two forms in this sample. The projects form has a tasks subform with start and end date combos. As soon as a start day is entered, the same data is duplicated into the next record. Of course, I don't want that to happen.

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

    Re: Combos for Dates (Access2003 SP2)

    A continuous form actually only contains one set of controls, regardless of how many records are displayed.
    Since the day, month and year combo boxes are not bound to a field in the record source, they will display the same values in all visible records, so for example when you select a month in the first record, you will see the same month in all other records. But since the combo boxes are not bound to a field, no data have been copied to the other records. The user will have to select a year in another record before the date will actually be set.

    Personally, I wouldn't use three combo boxes to let the user enter a date. I would let the user enter it directly in the text box. If you set its Format to Medium Date, there can be no ambiguity about the interpretation of a date, but the user can still enter it any way he/she likes.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combos for Dates (Access2003 SP2)

    Thanks. Your explanation makes sense. However if the user was desperate to use three combo boxes, how would I go about it?

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

    Re: Combos for Dates (Access2003 SP2)

    One way would be to replace the date field in the table with separate day, month and year fields. You could then bind the combo boxes to those fields. Bound controls display can different values for each record, so this would get rid of the seeming duplication.
    Another solution is to put text boxes over the combo boxes, as in the thread starting at <post:=573,995>post 573,995</post:>. Seems a lot of work for this problem though.

  7. #7
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combos for Dates (Access2003 SP2)

    Oh well. It seemed like a good idea at the time. Once again, thanks for your help.

    Regards
    Nick

Posting Permissions

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