W
Which1
In my project I have a main form which shows all records. You can add
records by clicking a command button. When the button is pressed a new form
opens which has a tab control with 6-8 tabs, with each tab having a different
subform. Each subform has an associated table. Each table is related to one
main table on a one-one relationship. Referential integrity is checked with
cascading delete checked.
The only way to close the form is by clicking the "X". In the form Unload
event I have code to ask if you want to save the record.
My problem is, once I click the "X" I get a msg box stating that my primary
key field can't contain a null value and to enter a value. I click ok then
another msg box comes up stating that my project encountered a problem saving
the record and if I close I will lose my changes. I click yes to close the
database object anyway. Then I finally get my message box asking to save the
changes.
My question is how can I exit the form without saving the record and
avoiding the record errors.
Thanks in advance for your help
records by clicking a command button. When the button is pressed a new form
opens which has a tab control with 6-8 tabs, with each tab having a different
subform. Each subform has an associated table. Each table is related to one
main table on a one-one relationship. Referential integrity is checked with
cascading delete checked.
The only way to close the form is by clicking the "X". In the form Unload
event I have code to ask if you want to save the record.
My problem is, once I click the "X" I get a msg box stating that my primary
key field can't contain a null value and to enter a value. I click ok then
another msg box comes up stating that my project encountered a problem saving
the record and if I close I will lose my changes. I click yes to close the
database object anyway. Then I finally get my message box asking to save the
changes.
My question is how can I exit the form without saving the record and
avoiding the record errors.
Thanks in advance for your help