Deleting a new record

namron

New member
Local time
Today, 17:01
Joined
Mar 10, 2018
Messages
15
Hi

I have a form to create a new client record which contains a tab control, the various tabs contain sub forms for creating related client information on other tables e.g an 'Address History'table.
The first tab contains the main basic information about the client held in the 'Clients' table.

Occasionally users want to abandon the creation of the new client for whatever reason. To accomodate this I created a button on the first tab called 'Exit without saving' which triggers an 'Undo' action, shows a confirmation msgbox and closes the form.

The problem I have is that this only works if they have not gone into any of the other tabs to enter information. As soon as they leave the 'Main' tab, the client record is saved.

Is there any way I can prevent the record from saving until the user is ready to commit what they have entered on the various tabs into the various tables?

Or are there any suggestions for dealing with this scenario?

Thanks

Norman
 
Try BeforeUpdate event to confirm they want to proceed and if they do cannot cancel. Might be able to do something with Transactions method which is rather advanced coding I have used once. Otherwise, not really.

Maybe forms on other tabs should be subforms. Why is 'Main' tab not the 'Main' form?
 
Last edited:
Hi, thanks for the reply. The 'Main' tab contains fields bound to the 'Clients' table. The other tabs contain subforms bound to related tables.
 
So main tab does not have subform? Comments still apply.
 
Hi

Thanks everyone for your comments and pointing me in the right direction.

I've been able to use the BeforeUpdate event in the form to request the user's confirmation that the new record should be committed before being able to proceed to enter data in other tabs/subforms.

Norman
 

Users who are viewing this thread

Back
Top Bottom