Dmax??

racemadnss

Registered User.
Local time
Today, 09:40
Joined
May 18, 2004
Messages
58
Hey All, Ive got a form that im trying to make my own auto number for, b/c I alread have another field using Autonumber.

Im using a text field b/c I want to have the Default value = "Autonumber" so that it appears to be an auto number.

Can you use DMax on a text field? If not is there any other way to find the max Number in a text field?

Thanks
 
You can use Dmax, but remember a text field value is not numerically the same as a number value.

1
11
19
2
21
3

would be the order in text, and Dmax would return 3 and not 21 as you might think.
 
Oh, thats not cool...

hmm...I could change it to a number field but then I have to go do that on all the Related tables.
 
Why would you want the key to appear to be an autonumber if it is not? Why not just use the real thing?

An awful lot of effort seems to be expended by posters here in recreating the wheel regarding autonumbers. They work the way they do for a reason.

If you get down to the real requirements of an application, there are very few where an unbroken sequence of sequentially assigned numbers is required. Pre-printed checks or invoices come to mind. All other requirements of this ilk are really preferences or simple lack of understanding of what a primary key is for.
 
If this is truly a sequencial field, why not pickup your current autonumber field value and use it in this field? Maybe you havn't explained it good enough for us to understand, can you clearify what you are actually trying to do besides use a "autonumber"?
 

Users who are viewing this thread

Back
Top Bottom