From: RacheleP on
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.
From: Daniel Pineault on
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.



"RacheleP" wrote:

> 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.
From: RacheleP on
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

"Daniel Pineault" wrote:

> 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.
>
>
>
> "RacheleP" wrote:
>
> > 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.
From: KenSheridan via AccessMonster.com on
Roger Carlson has a simple solution, which avoids conflicts in a multi-user
environment, at:

http://www.rogersaccesslibrary.com/forum/forum_posts.asp?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/forum.aspx?nav=libraryMessages&tsn=1&tid=23839&webtag=ws-msdevapps


Ken Sheridan
Stafford, England

RacheleP wrote:
>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.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: a a r o n _ k e m p f on
Dont delete records??? For any reason, period!?!?!




On Mar 3, 6:46 am, RacheleP <Rache...(a)discussions.microsoft.com>
wrote:
> 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.