A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

autonumber



 
 
Thread Tools Display Modes
  #1  
Old December 13th, 2006, 07:37 PM posted to microsoft.public.access.forms
ielmrani via AccessMonster.com
external usenet poster
 
Posts: 69
Default autonumber

I have a table with a primary id, data type is autonumber. My issue is: the
table had some data in it. I deleted the data. Now I am trying to enter new
data, the autonumber is not starting from 1, 2, etc...it starts at the last
number before the data got deleted (19,20,etc). How can I make fix it. I
hope I am not confusing you.
Thanks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

  #2  
Old December 13th, 2006, 08:04 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default autonumber

1) Delete the data from your current database.
2) Create a new blank database
3) Import all controls from old database
4) The Autonumber of your table will now be reset at 1


ielmrani wrote:
I have a table with a primary id, data type is autonumber. My issue is: the
table had some data in it. I deleted the data. Now I am trying to enter new
data, the autonumber is not starting from 1, 2, etc...it starts at the last
number before the data got deleted (19,20,etc). How can I make fix it. I
hope I am not confusing you.
Thanks


--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

  #3  
Old December 13th, 2006, 08:28 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default autonumber

That's exactly how Autonumbers are meant to behave.

Autonumbers exist for one purpose only: to provide a (practically
guaranteed) unique value that can be used as a primary key. That purpose is
fulfilled by 19, 20, 22 just as well as by 1, 2, 3. It's actually considered
normal not to even show the value of the Autonumber field to the users.

If you're trying to assign some meaning to the value of the Autonumber
field, then you likely shouldn't be using Autonumbers.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"ielmrani via AccessMonster.com" u21259@uwe wrote in message
news:6ab6855a96ee0@uwe...
I have a table with a primary id, data type is autonumber. My issue is:
the
table had some data in it. I deleted the data. Now I am trying to enter
new
data, the autonumber is not starting from 1, 2, etc...it starts at the
last
number before the data got deleted (19,20,etc). How can I make fix it. I
hope I am not confusing you.
Thanks

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1



  #4  
Old December 13th, 2006, 08:29 PM posted to microsoft.public.access.forms
ielmrani via AccessMonster.com
external usenet poster
 
Posts: 69
Default autonumber

Worked. Thank you very much.

missinglinq wrote:
1) Delete the data from your current database.
2) Create a new blank database
3) Import all controls from old database
4) The Autonumber of your table will now be reset at 1

I have a table with a primary id, data type is autonumber. My issue is: the
table had some data in it. I deleted the data. Now I am trying to enter new
data, the autonumber is not starting from 1, 2, etc...it starts at the last
number before the data got deleted (19,20,etc). How can I make fix it. I
hope I am not confusing you.
Thanks



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200612/1

  #5  
Old December 14th, 2006, 09:54 AM posted to microsoft.public.access.forms
Keith Wilby
external usenet poster
 
Posts: 812
Default autonumber

"ielmrani via AccessMonster.com" u21259@uwe wrote in message
news:6ab6fa11cd4c8@uwe...
Worked. Thank you very much.


It worked but you're using AutoNumber for the wrong purpose. AutoNumber is
intended for indexing purposes internal to Access. If you want unique and
sequential numbering, try this as the default value of a text box bound to a
numeric field:

Nz(DMax("MyField","MyTable"))+1

where MyField is the name of your field and MyTable is the name of the table
containing the field.

Keith.
www.keithwilby.com


  #6  
Old December 14th, 2006, 02:49 PM posted to microsoft.public.access.forms
ielmrani via AccessMonster.com
external usenet poster
 
Posts: 69
Default autonumber

thank you guys for the info.

Douglas J. Steele wrote:
That's exactly how Autonumbers are meant to behave.

Autonumbers exist for one purpose only: to provide a (practically
guaranteed) unique value that can be used as a primary key. That purpose is
fulfilled by 19, 20, 22 just as well as by 1, 2, 3. It's actually considered
normal not to even show the value of the Autonumber field to the users.

If you're trying to assign some meaning to the value of the Autonumber
field, then you likely shouldn't be using Autonumbers.

I have a table with a primary id, data type is autonumber. My issue is:
the

[quoted text clipped - 5 lines]
hope I am not confusing you.
Thanks


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.