>I have a table that has pool, hand and number fields. If the user wants to add a new record, I check the table for the pool that the user wants to add a record for. If it isn't in the table, I give that record a number of 1. If it is I want to increment the last number for that pool by one. So there would be multiple records with the value of 1 or any other number for that matter. I can't think of a way to do this. Any help would be appreciated.Thanks,
>
>Tyler
Off the top of my head:
lparameters tnpoolID
lnretval = 0
use pool_table
=cursorsetprop("buffering",2)
if !seek(tnpoolID) then
insert into pool_table (key, value) values (tnpoolID,1)
lnretval = 1
else
replace key with key
lnretval = key + 1
replace key with lnretval
endif
if tableupdate() then
return lnretval
else
return 0
endif
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao