Tom,
Borrowed from Razzak's salesorder form (d_comments is the permanent table,
tcomments is the temporary table used for entering data):
-- In a multi-user environment, check to make sure that the CommentID is
-- still good. If not, get the new CommentID and inform the user.
SELECT (MAX(comment_id)+1) INTO vnewcommentid INDICATOR ivnewcomid +
FROM d_comments
IF vcommentid <> vnewcommentid THEN
UPDATE tcomments SET comment_id = .vnewcommentid
SET VAR vmsg = ('Please note the new Comment ID:'&(CTXT(.vnewcommentid)))
SET VAR vcaption = 'Comment Id has changed!'
CLS
PAUSE 2 USING .vmsg CAPTION .vcaption icon info
SET VAR vcommentid = .vnewcommentid
ENDIF
APPEND tcomments TO d_comments
Claudine :)