Re: Finding a record number using SQL



In any DB you need a primary unique key. In Accesss you can use a "counter"
type large integer and the system will increment it for you. Include the
column defined as counter in your recordset. Then when you insert a record
and post it, the db will populate the field for you. You then do a "locate"
on the key. Something like this ...

disablecontrols
insert
fieldbyname('xxx').asstring = 'sometheing'
fieldbynaem('yyy').asfloat := 12345
post
savekey := fieldbyname('counterfield').asfloat
locate('counter', savekey,[])
enablecontrols



.