Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you to decrement AutoNumber??

Status
Not open for further replies.

BingeThinker

Programmer
Mar 20, 2003
9
0
0
US
Hi,

Background
----------
I have a database with two tables. One table has families in it and the other table has family members. They family table has a primary key called FamilyID and the member table has a foreign key called FamilyID. There is a one to many relationship (one family to one or more members). I have the table set up so that the primary key FamilyID is an "AutoNumber". I have a query which accesses both tables and this query I use to propagate a form called Family Form.

Problem
-------
What I am having a problem with is if the user hits the escape key after entering some info on the form, it blanks out all of the information that had been entered. Then when they begin to enter info again in the form (without closing the form) the AutoNumber has been incremented! Is there any object (doCmd for example) that will allow me to decrement the AutoNumber or is there a "manual" way of using a counter that can be decremented?

Thanks and I hope I have given enough info:)
 
No there is no - any what's more - if you are using an AutoNumber for what an AutoNumber should be used for then the fact that there is not a way of doing it should not matter to you one single jot.

There is no real reason why AutoNumber fields should be a continuous sequence, so who cased if it skips a few number.

Try this
Enter a record in the Family table - Jones
Then enter in the mmbers table John and Sally ( Mr & Mrs Jones )

Then add lots more families and lots more members

Then when Mrs Jones has a baby - add Timmy to the members table

What has that done to your number sequence ?

Then add lots more data

Then, in a year's time add Timmy's little sister Anne

What has that done to your number sequence ?


Do you see what I'm getting at ?


'ope-that-'elps.




G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Did you see this thread: thread181-502982

I am having the same problem, and this thread might help us. Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top