Jim,
As a general rule, this is a bad thing to do. In a multi-user environment this approach will prevent others from adding records while a transaction is open. Transactions should really be used along with buffering and kept open for a minimal amount of time.
That said, with no buffering how are you determining whether the record is new and needs to be validated? It would seem to me that the locate would always find a match unless the textbox is not bound to the table.
I would reccomend you switch to a buffered environment. Below is an approach to validation that will not move the record pointer off the record currently being added:
lFound = .F.
if [it's a new new_record ]
select count(id_no) as NumberFound from drawing ;
where drawing.id_no == this.value into cursor tValid
lFound = tValid.NumberFound > 0
if lFound
=MessageBox(drawing.id_no+' already exists!')
endif
use in tValid
endif
return ! lFound
I hope this helps.
>Hi again,
>
>BTW. it's in a TRANSACTION and buffering still is none.
>
>>What type of buffering are you using? I'll try to reproduce the problem and see if I can get it figured out for you.
kenweber
GCom2 Solutions
Microsoft Certified Professional