Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto increase number
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00853567
Message ID:
00858938
Views:
15
I have a si,ilar situation where I need to generate lot numbers without any gaps. I solved the problem by putting this code in the PreSaveHook().

CALCULATE(MAX(nLotNumber)) to nLastLotNumber
nNextLotNumber = nLastLotNumber + 1

I indexed the table on the LotNumber field for efficiency and I haven't had any speed complaints.

HTH,
BobK

>Hi,
>I want to generate auto number for document such as invoice, PO and etc. Any function built in in MM for this purposes? I tried newid() but it will increase the value even the record is not saved. I don't want to have "hole" between theese number. Any ideas?
>
>Thank you
Bob Kocher
www.swfox.net
Start making your plans now to attend Southwest Fox 2006
Previous
Reply
Map
View

Click here to load this message in the networking platform