N
Ngan
Hi,
I have a main form and a subform. When the users create a new record in the
main form, some pieces of data are automatically filled in. Then the users
are supposed to fill in the related data in the subform, but they don't
always do :-(, hence creating a lot of unnecessary records in the main table.
I understand that I can use the BeforeUpdate event in the main form to
confirm and/or discard the pending main record if the users nagivate away
from it without entering anything in the subform. However, the BeforeUpdate
event is also called out when the users do click on the subform to enter real
data. So how do I, in the BeforeUpdate event of the main form, flag this
particular case (when the user "actually" click on the subform to enter data)
to stop the confirmation?
To make things worse, more often than I want to, the users will actually
click on the subform as if they would enter any data, and then abandon it
altogether. In this case, it's already too late to catch it by utilizing the
BeforeUpdate event on the main form since the main record has already been
created. Is there a way of detecting when the users leave the current main
record, running a query against the related table, and if nothing is found,
deleting that childless main record? From reading various posts here, that
seems improbable, but I thought I might as well ask....
Thanks for all your help
I have a main form and a subform. When the users create a new record in the
main form, some pieces of data are automatically filled in. Then the users
are supposed to fill in the related data in the subform, but they don't
always do :-(, hence creating a lot of unnecessary records in the main table.
I understand that I can use the BeforeUpdate event in the main form to
confirm and/or discard the pending main record if the users nagivate away
from it without entering anything in the subform. However, the BeforeUpdate
event is also called out when the users do click on the subform to enter real
data. So how do I, in the BeforeUpdate event of the main form, flag this
particular case (when the user "actually" click on the subform to enter data)
to stop the confirmation?
To make things worse, more often than I want to, the users will actually
click on the subform as if they would enter any data, and then abandon it
altogether. In this case, it's already too late to catch it by utilizing the
BeforeUpdate event on the main form since the main record has already been
created. Is there a way of detecting when the users leave the current main
record, running a query against the related table, and if nothing is found,
deleting that childless main record? From reading various posts here, that
seems improbable, but I thought I might as well ask....
Thanks for all your help