>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,
Michel reading quickly maybe I'm also missing but after "use keylist in 0" you don't select keylist so locating in current (which is most likely EOF).
Cetin