The form I am working on allows users to change the name of an existing corporation and record the date of the name change.
The form has 2 command buttons. The first button verifies the date and closes the form (as long as the date is valid). The second button allows the user to abort the name change and exit the form.
When exiting the form, I can't just delete the last record in the table because there might be occasions where the user accidentally goes into the form and wants to exit immediately without entering a new record.
QUESTION: Is it possible to build some sort of "If" structure into the VBA code of the Exit command button so that deletion of the last record occurs ONLY when a new record has truly been added?
I suppose I could use 2 Exit command buttons: Click Exit Button 1 if you did NOT try to enter a new record; and Click Exit Button 2 if you DID try to enter a new record and decided NOT to keep it.
But this seems very cumbersome. Any suggestions?
The form has 2 command buttons. The first button verifies the date and closes the form (as long as the date is valid). The second button allows the user to abort the name change and exit the form.
When exiting the form, I can't just delete the last record in the table because there might be occasions where the user accidentally goes into the form and wants to exit immediately without entering a new record.
QUESTION: Is it possible to build some sort of "If" structure into the VBA code of the Exit command button so that deletion of the last record occurs ONLY when a new record has truly been added?
I suppose I could use 2 Exit command buttons: Click Exit Button 1 if you did NOT try to enter a new record; and Click Exit Button 2 if you DID try to enter a new record and decided NOT to keep it.
But this seems very cumbersome. Any suggestions?