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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Random Autonumber



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2005, 09:54 PM
Tru
external usenet poster
 
Posts: n/a
Default Random Autonumber

I have a autonumber random field "Customer ID" that sometimes generates
negative numbers is there a way to have this field generate positive numbers
only.
--
Thanx!
  #2  
Old July 7th, 2005, 10:02 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default

Tru wrote:
I have a autonumber random field "Customer ID" that sometimes
generates negative numbers is there a way to have this field generate
positive numbers only.


No. What I do in a few places is use Random AutoNumbers but display them as
Hex values. This produces a character/digit string that is always 6
characters long and there is never a negative sign.

Otherwise you would have to "roll your own" method for assigning the numbers
instead of using AutoNumber.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #3  
Old July 7th, 2005, 11:53 PM
Brian
external usenet poster
 
Posts: n/a
Default

Is there a reason you are using Random instead of Increment?

"Tru" wrote:

I have a autonumber random field "Customer ID" that sometimes generates
negative numbers is there a way to have this field generate positive numbers
only.
--
Thanx!

  #4  
Old July 8th, 2005, 08:23 AM
Tru
external usenet poster
 
Posts: n/a
Default

Thanx! This was the first time i tried random autonumber i wont use it again.
But your hex format is a great idea.

"Rick Brandt" wrote:

Tru wrote:
I have a autonumber random field "Customer ID" that sometimes
generates negative numbers is there a way to have this field generate
positive numbers only.


No. What I do in a few places is use Random AutoNumbers but display them as
Hex values. This produces a character/digit string that is always 6
characters long and there is never a negative sign.

Otherwise you would have to "roll your own" method for assigning the numbers
instead of using AutoNumber.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



  #5  
Old July 8th, 2005, 08:24 AM
Tru
external usenet poster
 
Posts: n/a
Default

Just to try it out, silly me!

"Brian" wrote:

Is there a reason you are using Random instead of Increment?

"Tru" wrote:

I have a autonumber random field "Customer ID" that sometimes generates
negative numbers is there a way to have this field generate positive numbers
only.
--
Thanx!

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Table ... Random Autonumber in SQL??? Dial222 Running & Setting Up Queries 4 August 12th, 2005 04:31 PM
Access 2000, autonumber fields Zyberg74 General Discussion 3 November 17th, 2004 04:24 PM
Problem with AutoNumber accessmonk Database Design 2 September 30th, 2004 08:57 PM
Autonumber Ally H. General Discussion 7 August 27th, 2004 04:51 PM
Random Function in VB Jim Campbell New Users 10 August 8th, 2004 12:33 AM


All times are GMT +1. The time now is 10:46 AM.


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