Me.undo

E-D

Registered User.
Local time
Today, 21:51
Joined
Dec 31, 2001
Messages
42
hi guys. I really need your help:
I have a form for Suppliers Orders.
Every record has it's SuppliersOrdersID which must be a running number.
My q is: When I open a new record and I want to cancel it for some reason, which code line should I use. I'm asking because
When I use Me.Undo it erases the record, however goes automatically to the next record
and as I previously said I can't allow that
cause I need sequential numbers.
what should I do?
 
You're using Autonumber for something it's not intended for. It's designed to provide each record with a unique number; it makes no guarantees about sequences being unbroken.

You'll have to design your own field to get the functionality that you're asking for. The DMax() function will help, but be careful to account for what happens if two entries are started at the same time.

Good luck,
David R
 
I see. But Don't you think I can Undo
A new record? If such an option doesn't exist I'll try the dmax() function out ..

thanks for replying
 
David R - I took your advice. I've used the dmax function and it's doing a great job
thanks
 
You are undoing the record, but Access (for whatever reason) doesn't recycle autonumbers. Wait til you do an Append Query and cancel it. Your AN field will gap the size of the Grand Canyon. Just ignore it and move on.
If you don't have data in your tables yet, you CAN set your new DMax()'ed field to your PK, but otherwise you'll break all sort of relationships in your existing data trying to sort it out.

Glad you got it working,
David R
 

Users who are viewing this thread

Back
Top Bottom