There has got to be a simple solution to this problem but I can’t seem to be able to find it…
I created a Form to add records to a Table. There are Command Buttons to Save the record and Close the Form. I also load half a dozen fields with default values using the OnCurrent Event Procedure. When the users save the record and then close the Form everything works fine. But if they go to add a record but then change their mind and close the Form the Form adds the partially created record.
I tried using the Form’s BeforeUpdate Event Procedure to check to see if the record is ‘dirty’ and then ‘undo’ it (which works) but my problem is I can’t then close the Form after its undone. I can‘t seem to be able to find a ‘Close Form’ command which will work inside the Event Procedure of the Form being closed.
So my question is, how do you prevent a Form from adding a record upon the closing of that Form?
Currently, I run a program after the Form is closed which reads through the entire Table deleting any ‘blank’ records but this is a pretty ugly solution. Any suggestions you have would be appreciated. Thx.
I created a Form to add records to a Table. There are Command Buttons to Save the record and Close the Form. I also load half a dozen fields with default values using the OnCurrent Event Procedure. When the users save the record and then close the Form everything works fine. But if they go to add a record but then change their mind and close the Form the Form adds the partially created record.
I tried using the Form’s BeforeUpdate Event Procedure to check to see if the record is ‘dirty’ and then ‘undo’ it (which works) but my problem is I can’t then close the Form after its undone. I can‘t seem to be able to find a ‘Close Form’ command which will work inside the Event Procedure of the Form being closed.
So my question is, how do you prevent a Form from adding a record upon the closing of that Form?
Currently, I run a program after the Form is closed which reads through the entire Table deleting any ‘blank’ records but this is a pretty ugly solution. Any suggestions you have would be appreciated. Thx.