Another was to Autonumber?

R

RacheleP

Ive searched high and low in this group and have learned that Autonumber is
not the best way to assign a unique (PrimaryKey) number. What I havent been
able to figure out is the best way to accomplish my goal.

I am issuing Returned Goods Authorizations (RGA's) to customers. I dont
want my user to have to find the next RGA number to use. How do I get Access
to assign the next RGA number when my user goes into the Form to enter the
data? I need the database to start with 3642 as the next RGA number.
 
D

Daniel Pineault

There is nothing wrong with using an AutoNumber! It depends on what you are
trying to do. Typically, Autonumbers will be sequential and will show you
gaps when records are deleted.

If you wish to manually replicate this feature then you will need to use the
DMax() function to find the greatest entry in your id field and then add 1 to
it to determine the next id number.

Also, typically autonumber/PK are for internal purposes and not for the
end-user. If you need to create a sequential RGA number, create a RGA_No
field as long and then use the DMax() function as stated above to populate
it. Make sure you set it to not allow duplicates.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
R

RacheleP

Daniel,

Thanks so much for your help and fast response.

I prefer the RGA numbers to stay in sequential order. I am unfamiliar with
the DMax function and how to use it. Would you please walk me through it? I
have a table in which the primary key is the field RGANumber. There are
other tables that are related by that primary key. I have a data entry Form
where the information is entered. Let me know if you need any other info.

Thanks!
Rachele
 
R

RacheleP

Thanks Ken and Daniel. It took some trial and error but its working
perfectly now. Thanks again!

Rachele

KenSheridan via AccessMonster.com said:
Roger Carlson has a simple solution, which avoids conflicts in a multi-user
environment, at:

http://www.rogersaccesslibrary.com/...?TID=395&SID=83z7c11zc7b721d2a1e51989c53d7ffb


A slightly more complex solution, which allows the next number to be used to
be 'seeded' is at:

http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23839&webtag=ws-msdevapps


Ken Sheridan
Stafford, England
Daniel,

Thanks so much for your help and fast response.

I prefer the RGA numbers to stay in sequential order. I am unfamiliar with
the DMax function and how to use it. Would you please walk me through it? I
have a table in which the primary key is the field RGANumber. There are
other tables that are related by that primary key. I have a data entry Form
where the information is entered. Let me know if you need any other info.

Thanks!
Rachele
There is nothing wrong with using an AutoNumber! It depends on what you are
trying to do. Typically, Autonumbers will be sequential and will show you
[quoted text clipped - 17 lines]
to assign the next RGA number when my user goes into the Form to enter the
data? I need the database to start with 3642 as the next RGA number.to start with 3642 as the next RGA number.

--



.
 
L

Larry Linson

"BruceM via AccessMonster.com" <u54429@uwe> wrote

Mr. Kempf is quick to issue edits, but not so quick to explain why and what
to do instead.

There can be good reasons for not deleting records and there can also be
circumstances in which there is nothing to be gained by saving inactive
information. If Mr. Kempf is as knowledgeable as he seems to think himself,
perhaps now he will explain some of those circumstances and the differences
between them.

Larry Linson
Microsoft Office Access MVP
 
D

Debra

RacheleP said:
Ive searched high and low in this group and have learned that Autonumber
is
not the best way to assign a unique (PrimaryKey) number. What I havent
been
able to figure out is the best way to accomplish my goal.

I am issuing Returned Goods Authorizations (RGA's) to customers. I dont
want my user to have to find the next RGA number to use. How do I get
Access
to assign the next RGA number when my user goes into the Form to enter the
data? I need the database to start with 3642 as the next RGA number.
 
D

De Jager

RacheleP said:
Ive searched high and low in this group and have learned that Autonumber
is
not the best way to assign a unique (PrimaryKey) number. What I havent
been
able to figure out is the best way to accomplish my goal.

I am issuing Returned Goods Authorizations (RGA's) to customers. I dont
want my user to have to find the next RGA number to use. How do I get
Access
to assign the next RGA number when my user goes into the Form to enter the
data? I need the database to start with 3642 as the next RGA number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top