LOCAL ni
ni = 0
SCAN
INSERT INTO lvw_wlevel (batchID, sp_id, site_id) VALUES ;
(batches.id, cGroup, std_wlvl_grps.site_id)
IF .NOT. TABLEUPDATE( 0, .T., 'lvw_wlevel' )
ni = ni + 1
DIMENSION aNoGo[ ni ]
SELECT lvw_wlevel
SCATTER NAME aNoGo[ ni ]
SELECT std_wlvl_grps
TABLEREVERT( .F., 'lvw_wlevel' )
ENDIF
ENDSCAN
IF ni > 0
*!* Then there were some well levels that failed the table update
SELECT lvw_wLevel
FOR EACH nj IN aNoGo
APPEND BLANK IN lvw_wlevel
GATHER NAME nj
IF .NOT. TABLEUPDATE( 0, .T., 'lvw_wlevel' )
= MESSAGEBOX( 'Unable to add a water level for ' + nj.site_id )
TABLEREVERT( .F., 'lvw_wlevel' )
ENDIF
NEXT nj
ENDIF
<\pre>
My work around is okay and since it is not doing anything flaky--IMHO--it's okay with me. It behaves predictably and only tries one additional time to add the record. If it fails that (and it hasn't so far), then the user is alerted and they can (in the worst case) add it themselves. :-( I gave up thinking it's a perfect world a few years ago.