>I am a little bit green in some areas. This is only my 2ed application :-) On the first one is was a geographic location that the user supplied. Any suggestions? thanks for your patients
Try something like this
* Get the next unique key
LOCAL lcAlias,lnOldRec,lnDernier,lnSelect
lcAlias=ALIAS()
lnSelect=SELECT()
SELECT TABLE
lnOldRec=SAVEREC()
SEEK lcAlias ORDER ALIAS
lnDernier=0
DO WHILE NOT RLOCK()
ENDDO
REPLACE CLE WITH CLE+1
UNLOCK
lnDernier=CLE
RESTREC(lnOldRec)
SELECT (lnSelect)
RETURN lnDernier
You may want to create TABLE.DBF, which contains the tables used in your application. At least, one field, CLE, is used to keep the current last unique id.