Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending doing replacing
Message
From
20/06/1998 12:43:04
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Appending doing replacing
Miscellaneous
Thread ID:
00110241
Message ID:
00110241
Views:
48
Hi all,

I'm leaving tomorrow and will be gone all week, so if I don't get a reply today, I won't see it until next Saturday. (Just so you know I'm not ignoring you)

As people suggested in another thread, I have a stored procedure that gets the next key number. In the default of the key, it calls this function. The problem is that when I have that in the default, every record it appends goes on top of the last one, so I always have only one record.

Here's the procedure code:

procedure GetKey
parameter lcKeyName

local lnKeyNum

use KeyList in 0

locate for alltrim(KeyList.KeyName) = alltrim(lcKeyName)
replace KeyList.KeyNum with KeyList.KeyNum + 1
lnKeyNum = KeyList.KeyNum

select KeyList
use

return lnKeyNum

Here's what's in the default of the field clientkey: getkey('client')

What am I doing wrong?

Thanks,
Next
Reply
Map
View

Click here to load this message in the networking platform