Results 1 to 6 of 6
  1. #1
    DukeLeto7 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    3

    Question Seting a date AND time in one control

    So I'm working with a simple Access 2010 database at home to track my productivity on a coding project, and that means a table with start and end times.



    Simple to do in table, harder to implement in form.

    What I'd LIKE to be doing is using the DateTimePicker ActiveX control to specify a date and a time within the same control bound to a single field. This doesn't seem to be possible as designed though. One instance of the DateTimePicker can set a date or a time, but NOT both. Googling yields little of value as anything discussing 'date time and datetimepicker' is parsed as a search redundancy.

    I can't be the only person to have dealt with this though.

    Right now, my solution is somewhat kludgy, there are two DateTimePicker controls bound to the single table datetime field, and one displays and allows you to set the date and one allows you to set the time. It's kludgy because they have a tendency to overwrite each other non constructively. (ie. You change the date in DTPicker1, but this does not update the table when change focus to DTPicker2 to mess with the time, which is still bound to the table field and is hiding a copy of the old date, and the old date is reset from DTPicker2's value. So the behavior is you change DTPicker1 from '1/25/2015' to '1/24/2015', click on DTPicker2 to modify the time, and find the DTPicker1 displays '1/24/2015' again when you're done.)

    Playing with the CustomFormat field has proved worthless.

    Has anyone found a more elegant solution to dealing with a date and a time in the same table field on one form? My latest idea is to split the table fields, and I really hate it.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you use the Now() function?

  3. #3
    DukeLeto7 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    3
    Quote Originally Posted by orange View Post
    Can you use the Now() function?
    Not practically. I'm generally editing a single record with a start time and an end time at once. The end time would generally correspond to the output of now(), but not always, and there'd be rounding.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    There are several date/time pickers in the demo here that can be downloaded. May be more than you need.
    Found via google.

  5. #5
    DukeLeto7 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    3
    Quote Originally Posted by orange View Post
    There are several date/time pickers in the demo here that can be downloaded. May be more than you need.
    Found via google.
    Yes, that does look like what I need, thank you.

    For future reference, what were the Google search terms you used to find it?

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    As I recall, I used utteraccess calendars and clocks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 07-20-2014, 06:22 PM
  2. Subtracting a date/time field from a number to get date/time
    By Lifeseeker1019 in forum Programming
    Replies: 4
    Last Post: 03-28-2014, 12:59 PM
  3. Replies: 1
    Last Post: 03-13-2014, 07:23 PM
  4. Replies: 1
    Last Post: 11-26-2013, 06:40 PM
  5. problem with MS Time and Date Control
    By LAazsx in forum Forms
    Replies: 1
    Last Post: 12-18-2010, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums