Jeff,
Let's look at your code again. 1st, make sure oVar.Sysdatapath is correct. I'm betting it is, since you've probably checked that 100 times.
Next, make sure that the USE ALLTRIM() line is executing. The (wrong) table might be already opened by another section of code, so when this routine runs the correct table will not open.
>Okay...you are right. So I'm back at square 1 again. because it is geared to be a multi user app. I was using the setup table to simple grab the next record id to assign a new entry, no matter what the table is bcause updates are made to varoius tables..
IF !USED('SETUP')
USE ALLTRIM(oVar.Sysdatapath) + 'SETUP.DBF' IN 0 SHARED
ENDIF
SELECT SETUP
LOCATE FOR ALLTRIM(TableName) == m.cAlias
< snip >
Steve Gibson