>Hi Cetin!
>
>What I mean is to search a record that are not save yet. here is the scenario: I have a data entry of delivery receipt wherein a delivery receipt detail have a various serial number to be entered(one-to-many relationship), to avoid duplication of serial number(in child table), i have to check it in dbf and in buffer, i used optimistic table buffering. Please help.. thanks!
>
>Mike
Still not clear. Anyway as I said xbase commands work in buffered tables. You can use seek, indexseek, locate etc etc.
ie:
-You're on a row and user entered new record data and a new serial number.
-BEFORE leaving the row you can use IndexSeek to see if it's a duplicate.
if indexseek(newserialnumber, .f., 'myAlias','serialtag')
messagebox('This serialnumber already exists')
endif
Remember you can use IndexSeek this way till you leave the row once. Any pointer movement causes IndexSeek() to return .T. even if that's not a duplicate but the serial you just entered.
If for any reason you can't use IndexSeek and your serial is not a primary key (otherwise you'd get violation error) you might use seek, locate as well. ie:
lnSerial = serialnumber && This is new record
lnRecno = recno()
locate for serialnumber = lnSerial and recno() # lnRecno
llExists = !eof()
Cetin