Hi Frank, Hi EHW,
Rather than us trying to answer specific questions (which may be correct in isolation but then turn out to be less valid in the overall context of your project), I thought I'd try and knock up a 'total' solution based on the information so far provided and then you pick out the relevant pieces as a way to move things forward yourself.
The approach I took was to simplify things as much as possible but without losing functionality - see attachment.
So now there is just one form where you view all of the equipment records (and summary information such as number of services, next service due etc) in a tablegrid, but also add, edit or delete service records; there is then a second form for your reference tables.
This will hopefully get over a couple of problem you were having, namely:
1). The 'next service date' that was in different formats on different forms, now only appears in the table grid and it's format can be easily adjusted in the script (there is an example of the syntax in the script, currently commented out).
2). More importantly, it is defined as a date so that it can be correctly sorted on; forcing your dates into text fields will normally mean that you lose sorting functionality (unless displayed as yyyy/mm/dd).
3). The 'next service due date' and the 'due in days' are calculated fields. As both are calculated fields,
3.1). no database updates are required,
3.2). a new service record (or change to or deletion of an existing service record's date) will automatically recalculate.
3.3). changes to the servicing interval (via the formlookups screen) will automatically recalculate the 'next service due date'.
This is the whole point of calculated fields, as well as avoiding data redundancy.
From what I've seen of your attached .pdf's in other posts, I don't know of anything that hasn't been basically covered.
Likewise, the main screen in my attachment (form1) could be easily re-arranged to more suit the layout of your .pdf with no changes to the underlying logic or script required.
I hope this manages to progress things.
Derek.
Post's attachments fc one form.zip 366.77 kb, 196 downloads since 2021-08-27