Hi there,
I got the table Person( PIN, CODE, FullName ), where PIN is primary key and CODE is defined as a Key (no PK). I want to search by CODE, so I should use:
Person.SETCURRENTKEY( CODE );
Person.CODE = '0001';
IF Person.FIND('=') THEN
MESSAGE('Person found')
ELSE
MESSAGE('Person not found');
Am I missing something? If I have the record 12345678, 0001, John Bear, the 'Person not found' Dialog window appers...
Thanks
0
Comments
Person.RESET;
Person.SETCURRENTKEY(CODE);
Person.SETRANGE(CODE,YourVar);
IF Person.FIND('-') THEN
MESSAGE('Person found')
ELSE
MESSAGE('Person not found');
You have to put a filter on your CODE field, like this :
Replace line
Person.CODE = '0001';
With
Person.SETFILTER(CODE,'0001');
And it works !! No ?