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!

Cancel Button without increase Primary Key

Status
Not open for further replies.

valterduarte

Technical User
Nov 25, 2005
15
PT
I have built a Cancel Button for a Data Entry Form, that closes the form without saving the record in the respective table, as I wanted.

However, the Primary Key increases a step. How do I avoid this?

Thank you!
 
This is standard behaviour for AutoNumber fields, dot.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV is saying that, if your primary key on the table is an AutoNumber field, then beginning the addition of a new record, even if you cancel it, will increase the value of the autonumber field. The only way around it is to create a primary key field whose value you manage rather than letting the system automatically generate it.
 
....and if you are assigning a meaning (like a sequential order number) to the Autonumber, you need to reconsider using this feature.

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top