Results 1 to 4 of 4
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    202

    Auto fill date in a form based on another field +15 min

    Good afternoon,

    I am attempting to auto populate a field based on another field. Here is the situation. I have a form that has multiple dates and times. I am attempting to auto populate my next date field based on a date/time from another field.
    1. I have combined a [date] and [time] field by using DateAdd(“n”, 15, [txtDateTime1]) successfully. That was easy
    2. I now need to auto populate my next field (let’s call it [Date2]) with a date that is +15 minutes from [DateTime1].
    3. To throw a wrench in it, I need to allow the end user to change that date if necessary and not auto populate the time.

    Date1 2/27/19
    Time1 2315



    Need the following:
    Date2 2/28/19
    Time2 <blank>

    Hope this is clearer than mud

    any ideas?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    You have multiple date/time fields in table? Why? What are the field names?

    Would have to use code (macro or VBA) to set value of field and allow user to change that value. Trick is figuring out what event to put code into.

    User can edit any part of the date/time.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    202
    There are multiple fields for different activities. they are to be 15 minutes apart and I am trying to avoid having them put that information in buy repeating the date excessively. Because the information is over a 24 hour period and can start any time of the day, the date cannot default to the first entry. I attempted to use Date2=Date1 but of course, if they changed the date, the would refer back to the vba code Date2=Date1. My fields are Date1 Time1
    Date2 Time2...
    and so on and so on....
    When join the date time it is txtDateTime1, txtDateTime2 ect
    .

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Date and Time parts are in separate fields? You have fields for each activity? Does not sound like normalized data structure.

    Sorry, still don't understand what you need. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-21-2015, 08:14 AM
  2. auto fill fields based on another field
    By dbell in forum Forms
    Replies: 18
    Last Post: 05-26-2014, 01:46 PM
  3. Auto Fill a date in a field
    By SJJ in forum Access
    Replies: 1
    Last Post: 02-17-2014, 02:39 PM
  4. Replies: 3
    Last Post: 12-24-2013, 04:20 PM
  5. Lock field after auto date fill
    By DCV0204 in forum Forms
    Replies: 4
    Last Post: 11-25-2013, 08:53 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