I think you are looking for a special WHERE clause
It sounds like: where count=insert It will return the last inserted row See: Help where COUNT=INSERT Refers to the last row inserted by the current user, even if it has been modified by another user. Tony From: [email protected] [mailto:[email protected]] On Behalf Of Jack Mathis Sent: dinsdag 4 mei 2010 17:50 To: RBASE-L Mailing List Subject: [RBASE-L] - Finding the autonum Is there a way to find the autonum number or the last autonum number used. I tried : SELECT PartRef + INTO test IND v1 + FROM Invent + WHERE COUNT = LAST But this gives me the last record inserted, even if it was a updated record, that had to insert because the notes field added more than the record pad allowed. SET VAR Test TEXT = NULL GETPROPERTY TABLE 'Invent->RECORDCOUNT' Test --From the R>Prompt gives me On XP x86 gives -- NULL On Windows 7 x64 -- Access violation at address 004047A8 in module 'rbg8ee.exe'. Read of address 53552039 SELECT MAX(PartRef) + INTO test IND v1 + FROM Invent This seems slow SET ERROR MESSAGE 2441 OFF SELECT PartRef + INTO test IND v1 + FROM Invent + ORDER BY PartRef + SET ERROR MESSAGE 2441 ON I figured if I could get the autonum number it might be faster yet, without errors. Thanks Jack <mailto:ja...@ericksonaircrane> Mathis Erickson Air-Crane Incorporated Computer Software Applications Programmer

