I got the thing to work. It may not be the cleanest but it will suit my needs at this point. Basically what I am doing is including the statement "Output inserted.InvRecordNO" in the SQL. If the SQL succeeds then I call "=SQLEXEC(dbHandle,"Select * from inserted") " and then r=VAL(sqlresult.invRecordNo)" . This returns the new primary key to me. I hate to hit the database twice and think it very strange that SQL Server would return the integer invRecordNo as a character string.
Thank you all for your help!
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!