Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid question
Message
From
14/12/1999 13:13:25
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00303412
Message ID:
00303486
Views:
27
Thanks for your reply, now I know where to put the code.
I noticed in your code snippet, you are setting the key the hard way. I use a stored procedure as the default value for my primary keys

function new_key
parameters tbl_name, key_field
private newkey
select max(&key_field) from &tbl_name into array temp
if _tally >0 && found records
newkey = temp(1)+1
else && empty table
newkey = 1
endif
return newkey

then in the key field's default value I put new_key("sometbl","keyfield")
and I never worry about unique keys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform