dbTalk Databases Forums  

How to set a starting number of the ID (set to autonumber and primary key)?

comp.databases.ms-access comp.databases.ms-access


Discuss How to set a starting number of the ID (set to autonumber and primary key)? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jim Devenish
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber andprimary key)? - 05-02-2011 , 02:54 AM






On May 2, 4:41*am, AA Arens <bartvandon... (AT) gmail (DOT) com> wrote:
Quote:
On May 2, 5:58*am, Tony Toews <tto... (AT) telusplanet (DOT) net> wrote:





On Fri, 29 Apr 2011 23:56:43 -0700 (PDT), AA Arens

bartvandon... (AT) gmail (DOT) com> wrote:
Ok, I will then add a new column in the table to be used as (in this
case) client nr.

If the sales person add a new record, there will be a new client nr.

The reason why I want to start with 4000 is to make unique nrs for
everyt sales person. Another person start with 5000.

Why bother? * Add a column for Sales Person ID pointing to a Sales
Person table. *And display the Sales Person name on all relevant forms
and reports.

Tony

--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
* updated seehttp://www.autofeupdater.com/

I want to have a client ID number that is increment with one after
every add record command. I get an error when setting up that
additional column and set to Autonum as it will always start with one.

So I was thinking to not to set to AutoNum but an increment if the ID
nr via the code.

I just don't understand the complex code that was given. I use to work
with it for long time, but this time i just get stuck.

Salespersons etc. are not the concern. Every person gets their own
base but the client nr (prospects) get an unique number for
identification.

John - 4000, 4001, ...
Patrick - 5000, 5001, ....
What happens when John reaches number 4999 and then gets another
client? Don't say that it will never happen. These things always do
- at some time in the future.

Reply With Quote
  #12  
Old   
AA Arens
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber andprimary key)? - 05-02-2011 , 09:31 PM






On May 2, 2:54*pm, Jim Devenish <internet.shopp... (AT) foobox (DOT) com> wrote:
Quote:
On May 2, 4:41*am, AA Arens <bartvandon... (AT) gmail (DOT) com> wrote:



On May 2, 5:58*am, Tony Toews <tto... (AT) telusplanet (DOT) net> wrote:

On Fri, 29 Apr 2011 23:56:43 -0700 (PDT), AA Arens

bartvandon... (AT) gmail (DOT) com> wrote:
Ok, I will then add a new column in the table to be used as (in this
case) client nr.

If the sales person add a new record, there will be a new client nr.

The reason why I want to start with 4000 is to make unique nrs for
everyt sales person. Another person start with 5000.

Why bother? * Add a column for Sales Person ID pointing to a Sales
Person table. *And display the Sales Person name on all relevant forms
and reports.

Tony

--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
* updated seehttp://www.autofeupdater.com/

I want to have a client ID number that is increment with one after
every add record command. I get an error when setting up that
additional column and set to Autonum as it will always start with one.

So I was thinking to not to set to AutoNum but an increment if the ID
nr via the code.

I just don't understand the complex code that was given. I use to work
with it for long time, but this time i just get stuck.

Salespersons etc. are not the concern. Every person gets their own
base but the client nr (prospects) get an unique number for
identification.

John - 4000, 4001, ...
Patrick - 5000, 5001, ....

What happens when John reaches number 4999 and then gets another
client? *Don't say that it will never happen. *These things always do
- at some time in the future.
Well, my intention is not to discuss about databases and pro's and
cons. I whish some body could help me with my issue.

Reply With Quote
  #13  
Old   
imb
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber andprimary key)? - 05-03-2011 , 03:07 AM



On May 3, 4:31*am, AA Arens <bartvandon... (AT) gmail (DOT) com> wrote:
Quote:
On May 2, 2:54*pm, Jim Devenish <internet.shopp... (AT) foobox (DOT) com> wrote:





On May 2, 4:41*am, AA Arens <bartvandon... (AT) gmail (DOT) com> wrote:

On May 2, 5:58*am, Tony Toews <tto... (AT) telusplanet (DOT) net> wrote:

On Fri, 29 Apr 2011 23:56:43 -0700 (PDT), AA Arens

bartvandon... (AT) gmail (DOT) com> wrote:
Ok, I will then add a new column in the table to be used as (in this
case) client nr.

If the sales person add a new record, there will be a new client nr.

The reason why I want to start with 4000 is to make unique nrs for
everyt sales person. Another person start with 5000.

Why bother? * Add a column for Sales Person ID pointing to a Sales
Person table. *And display the Sales Person name on all relevant forms
and reports.

Tony

--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
* updated seehttp://www.autofeupdater.com/

I want to have a client ID number that is increment with one after
every add record command. I get an error when setting up that
additional column and set to Autonum as it will always start with one..

So I was thinking to not to set to AutoNum but an increment if the ID
nr via the code.

I just don't understand the complex code that was given. I use to work
with it for long time, but this time i just get stuck.

Salespersons etc. are not the concern. Every person gets their own
base but the client nr (prospects) get an unique number for
identification.

John - 4000, 4001, ...
Patrick - 5000, 5001, ....

What happens when John reaches number 4999 and then gets another
client? *Don't say that it will never happen. *These things always do
- at some time in the future.

Well, my intention is not to discuss about databases and pro's and
cons. I whish some body could help me with my issue.- Hide quoted text -

- Show quoted text -
Hi Bart,

The one is not without the other. For a proper solution of a problem
you need to know the pros and cons.

For the unique clientnumber you can add an integer or longinteger
field to the client record and store your preferred clientnumber.
You can find the next number after inspecting the already used
numbers.

Imb.

Reply With Quote
  #14  
Old   
Bob Barrows
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber and primary key)? - 05-03-2011 , 08:45 AM



AA Arens wrote:
Quote:
Well, my intention is not to discuss about databases and pro's and
cons. I whish some body could help me with my issue.
Marshall did! What's wrong with the sample code he posted?

Reply With Quote
  #15  
Old   
AA Arens
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber andprimary key)? - 05-04-2011 , 07:04 AM



On May 3, 8:45*pm, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:
Quote:
AA Arens wrote:
Well, my intention is not to discuss about databases and pro's and
cons. I whish some body could help me with my issue.

Marshall did! What's wrong with the sample code he posted?
Hi all,

I copied/pasted the records of the already populated table till 3999.
Copy database for salesperson 2.
Then deleted the records of the first file. Compressed.
When opening the form and add a new record, the ID starts with 4000.

Next file till 4999. etc.

Thanks for all help

Reply With Quote
  #16  
Old   
imb
 
Posts: n/a

Default Re: How to set a starting number of the ID (set to autonumber andprimary key)? - 05-05-2011 , 08:10 AM



On May 4, 2:04*pm, AA Arens <bartvandon... (AT) gmail (DOT) com> wrote:
Quote:
On May 3, 8:45*pm, "Bob Barrows" <reb01... (AT) NOyahooSPAM (DOT) com> wrote:

AA Arens wrote:
Well, my intention is not to discuss about databases and pro's and
cons. I whish some body could help me with my issue.

Marshall did! What's wrong with the sample code he posted?

Hi all,

I copied/pasted the records of the already populated table till 3999.
Copy database for salesperson 2.
Then deleted the records of the first file. Compressed.
When opening the form and add a new record, the ID starts with 4000.

Next file till 4999. etc.

Thanks for all help
Hi Bart,

What I conclude from your answer is that you still use then Autonumber
ID as your clientnr, but now with a trick. I think you are going in
the wrong direction!

What is YOUR problem with a separate clientnr-field (type long, NOT
autonumber) to store the clientnr?


Imb.

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.