exit without saving..

miiia83

Board Regular
Joined
Feb 28, 2007
Messages
83
i have a program that registers customers and give them an IDno (autono). The id is automaticly the next available number and comes when they start filling in info about the new customer. BUT, if they for some reason want to stop the registration and clicks the x-button the IDno ex 202 is still used, so that next time it starts from 203..

Is it possible to get so that if they interrupt the registration the same IDno can be used again...

(did that make sence, hard to explain in foreign language)

Mia
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi Mia

This happens with autonumber fields when the user doesn't save their record before exiting from the table or form. The only way to recover the last lost autonumber(s) is to compact and repair the database (see menu option Tools > Database Utilities > Compact and Repair). This won't however bring back numbers that have been missed in the sequence - only the last one(s).

An alternative to using an autonumber is to create your field which gets the next number after the user has saved their record. This would take a bit of work and some VBA code. Before you pursue this option, consider this : does it matter if the sequence is incomplete?

Andrew
 
Upvote 0
thanks for the reply..

no I guess it really doesn't matter if it skipps a number... doesn't happen that often anyway.. just thought if there was an easy answer ...
 
Upvote 0
A fairly easy method might be to have the form fill out a temporary table with the exact same fields/formats (minus the auto# field) instead of the permanent table.

Create an append query to add the data from the temporary table to the permanent table.

Set a command button to run the query or macro (via macro, you can turn off the dialog box that notifies how many records appended by using the SetWarnings Action and then run the query using OpenQuery) saving the data and exit and a second button just to exit so they have a choice.

Max
 
Upvote 0
that sounded really complicated to me, since I didn't really understand it. Or I understood what you meant, but not how to do it..
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top