Cancel Feature help

Ethereal

Warcraft III Player
Local time
Yesterday, 22:30
Joined
Jan 17, 2006
Messages
99
Hi, I want my user to be able to "cancel" his entry. At first I tried just deleting the record they were working on. But that added numbers in the auto number "ID" field, and I also needed the feature for editing, so deleting wasn't an option. As of now I have something that works, but is kind of messy. I made a mirror "temp table" that I write the record to. If they "save" i append/update the record to the regular table, then delete it from the temp, if they "cancel" I just Delete it from the temp. Was wondering if there was a cleaner way to do this ?
 
The method you have chosen is pretty much the way it needs to be accomplished, considering your requirements. I would suggest a separate mdb for the temp tables to avoid any bloat and just kill it when you are done. Obviously you are *not* using the AutoNumber field in a manner for which it was designed or you would not care about the gaps in the sequence. You will probably be disappointed again later on in the development process but it is your project.
 
well, I don't care about the auto number for the ID, but my boss does :( , Thank you for your help though -- BTW i started playing DOOM II again since i saw ur avatar lol
 
There are methods of creating unbroken sequences of numbers, even in a multi user environment, that do not involve AutoNumber fields. You have already spent time coding around one of the drawbacks and you will probably need to do some more later on. I find it unlikely that your boss insisted on using AutoNumber fields for this operation, but it's your boss and his/her money. You might want to search this forum for sequential numbers just to see what methods people have used. It is really not that difficult and once it is done you can get back to using the AutoNumber fields for their intended purpose.
 
Right, well that makes a lot more sense. Now would I set my primary key to the auto number field, or the sequential field? (the auto number having no real purpose other than uniquely identifying record, I think ? )
 
Your PK would be the Autonumber field and no one but you would ever see it. It would be used as the FK in other tables. You should index the SequentialNumber field as unique so Access will toss an error (3022) that you can catch whenever there is a duplicate and you can get another number and try again.
(the auto number having no real purpose other than uniquely identifying record, I think ? )
This is *exactly* right.
 

Users who are viewing this thread

Back
Top Bottom