You need to collect the start date from the form's dirty event. Do NOT write the record at this point. In the form's AFTERupdate event, the record that was modified has been changed and you can now collect the end date. In this event you can write a single record that has both the start and end dates AND the recordID is also available for the record you are logging the time for.
There is NO reason to use a timer event. save the start time to a variable and then in the FORM's AfterUpdate event, you have everything you need. Running a timer does create overhead but if you need it you need it. But in this case, you do NOT need it.
A timer event is most commonly used for two things.
1. to detect idle time so you can force the database to close if the user has not pressed any keys in the specified amount of time.
2. The form is typically kept open for long periods and you want to force it to refresh.
Saving Start and Stop times when you have events that will capture these as I described are much simpler.
I have implemented your example and it is not writing either start or stop to the table. The start time is represented in the table in a line "new" but none of the other data is written and a new id# is not assigned. I have compared your example to mine and the only difference i see is your FTsubform calls the FT table directly as the source, and my FT subform calls a Query - is this why it is not functioning?
Attaching a copy of the database:
Rocket J Squirrel , Goofy Dawg, Bullwinkle DaMoose and Pluto Kaynyne are my testing names. Rocket has a record initiated for Today 3/6/21.
The form Un-Undelivered Mail Tracking is the one that creates the first record of the day. It works well, Creates the main record in the UN table, and records the Detail record in the UND, table and creates a record in the FT table with time start and end attached to the UNid. You can test it with any of the names above except Rocket as .. i already started a test record for him today.
The Form: Un Query1-find existing is the start of the 2nd round for the day. It allows Rocket J Squirrel to pull up his existing record for 3/6/21 and passes this to UN Query1-findexisting1 form so he can continue to edit the 1st subform detail records.
The detail records consist of the user entering a Case# (400, or 999 as you can see) and as soon as they tab from that field it writes the record start time, once they do the "thing" with the document - they then record the outcome, space bar or mouse click in the appropriate check box, (Uploaded, Problem, Unable to Locate (UTL)) - the record endtime is triggered of the Checkbox. Once they have completed what they are doing for the session, they click the close form button and the form closes.
The detail records write correctly in the UND file with a new UNDid for each entry and the UNid # matching Rocket J Squirrels UNid for the date. It lacks the fdate but I am unconcerned with that at the moment ... I know why that is happening.. lol
The FTsubform2 is the one that is NOT working and is part of the UN Query1-find existing1 form. It shows the line "new" with the start time, but it is not assigning the new record id and is not saving the end time when the form is closed.
I originally had the tab order set to be the LAST before button but moved it to Tab order 2 to match your example in the event that it needed to be initiated earlier ... this did not make a difference. it is still set at tab 2. In the end game, i want this FTsubform to be invisible to the worker so I had it at Tab 6 which is last before button.
I also started out with the VBA on current and before update with Fte=Now but tried changing it to Fte=time() just to see if that would make a difference, it did not, but it remains FTe=Time() in the VBA.
The reason i am jumping through hoops to find previous record and not simply doing the 2nd form as an "update" is .. Management does not want 40 employees cycling through their fellow employees records to find their own record to continue AND management does not wish me to implement a password system which would Isolate each employee from the others records.... fun fun. There may be a better approach to meet the above criteria than the path I am on .... but the path i am on is the only way i know
Thank you for all the help so far - and i am interested in your feed back regarding the system in general. I just noticed that the post i am replying to says AfterUpdate, but the example db you sent me has the event on BeforeUpdate.... this may also be why it is not functioning properly?