Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a part number
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00018858
Message ID:
00018875
Views:
32
>I have an inventory type table and when I enter a new part, I want VFP
>to automatically assign a unique part number to it. I know it can be done,
>is there an easy way. thanks for the help.

The easy way is to put a function in your Stored Procedures, and make the Default Value of the part number a call to that function.

select the table
save the record number
calculate max(part_no) to lnMaxPartNo
Go oldRecNo
replace part_no with lnMaxPartNo

That's the fast way. The better way is to save the next part number in another table, and lock that record, get the value, increment it, and unlock the record.

That clear enough, or did I garble it too much?
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform