G
Guest
I have a form and subform. The form has timesheet details such as name, week
ending and total time for this timesheet which is calculated from the
individual entries in the subform. This is the timesheet header record.
The subform is a datasheet where times are entered - one row for each entry.
These are the timesheet detail records.
If a person creates a new timesheet (header record), and then does not enter
any times in the subform (no detail records) before closing the timesheet, I
want to delete the blank timesheet header record.
I thought if I refresh the main form, and check if the total hours are zero
(there are no detail records), I would have a condition which would allow me
to decide to delete the timesheet header record. Unfortunately I cannot work
out which event to use.
Lostfocus happens when I move from the main form to the subform so that
cannot be used. I could be moving to the subform to creae the detail
records. On close happens when I close the form so I could have created a
header, and moved to another existing header record. Any suggestions as to
how this could be done, or if there is another way?
ending and total time for this timesheet which is calculated from the
individual entries in the subform. This is the timesheet header record.
The subform is a datasheet where times are entered - one row for each entry.
These are the timesheet detail records.
If a person creates a new timesheet (header record), and then does not enter
any times in the subform (no detail records) before closing the timesheet, I
want to delete the blank timesheet header record.
I thought if I refresh the main form, and check if the total hours are zero
(there are no detail records), I would have a condition which would allow me
to decide to delete the timesheet header record. Unfortunately I cannot work
out which event to use.
Lostfocus happens when I move from the main form to the subform so that
cannot be used. I could be moving to the subform to creae the detail
records. On close happens when I close the form so I could have created a
header, and moved to another existing header record. Any suggestions as to
how this could be done, or if there is another way?