E
Eka1618
Hello,
I am wondering how I can prevent records from being inserted on a partially
completed form. This form holds several subforms.
I have a 1:M between tblRequest and the following tables:
* tblTest
* tblLock
* tblkey
* tblLock_Key
* tblPattern
I have subforms that are bound to each of these tables. I want to prevent
adding a record in any of these tables if each table does not have at least
one record that is associated with tblRequest's PK [REQUEST_NO] OR if records
in any of the joining tables does not have a [REQUEST_NO] (which is used as
the FK in these tables).
In addition, If a user only partially completes a form, and then decides to
exit the form by clicking the form's close button, I do not want to see the
warning about not being able to create a record at this time. I am not sure
where to place the statement: DoCmd.SetWarnings...
There are a lot of forms on this page, I'm not sure what I can do to prevent
this from happening. I could always set validation rules. I think if I do
that, it will solve the problem of inserting the record. My main concern here
is that I am seeing the message "cannot create record at this time..." I have
tried to puting the setWarnings statement in the BeforeUpdate and
BeforeInsert events, but it was not allowing me to put it there. I am not
sure how to go about it.
If anyone has any suggestions on what I can do, please let me know.
Thank You!
I am wondering how I can prevent records from being inserted on a partially
completed form. This form holds several subforms.
I have a 1:M between tblRequest and the following tables:
* tblTest
* tblLock
* tblkey
* tblLock_Key
* tblPattern
I have subforms that are bound to each of these tables. I want to prevent
adding a record in any of these tables if each table does not have at least
one record that is associated with tblRequest's PK [REQUEST_NO] OR if records
in any of the joining tables does not have a [REQUEST_NO] (which is used as
the FK in these tables).
In addition, If a user only partially completes a form, and then decides to
exit the form by clicking the form's close button, I do not want to see the
warning about not being able to create a record at this time. I am not sure
where to place the statement: DoCmd.SetWarnings...
There are a lot of forms on this page, I'm not sure what I can do to prevent
this from happening. I could always set validation rules. I think if I do
that, it will solve the problem of inserting the record. My main concern here
is that I am seeing the message "cannot create record at this time..." I have
tried to puting the setWarnings statement in the BeforeUpdate and
BeforeInsert events, but it was not allowing me to put it there. I am not
sure how to go about it.
If anyone has any suggestions on what I can do, please let me know.
Thank You!