SETRANGE non filter !!

Back again,

ITEMS USED:
Table “Item Ledger Entry”(32), with the records:

Document No. Serial No.
A0001 0
A0020 SN0001

Record var (rec32)

CODE USED:
rec32.SETRANGE(“Serial No.”, SN0001);
message(‘value:%1’, rec32.“Documento No.”); //this prints “A0001” and don’t know why…

I’ve tried restarting the record with rec32.FIND(’-’) but nothing different appears. What am I doing wroong?, i used this function before and had no problem… [:’(]

you forgot to use FIND

You have to add rec32.FIND(’-’) AFTER SETRANGE line.

rec32.SETRANGE(“serial No.”, ‘SN0001’);
rec32.FIND(’-’);
MESSAGE(bla bla);

With some notices:
First, you need single-quotes on SN0001
Second, never execute FIND without error trapping IF FIND

Oooohhhhh,

I didn’t forgot the FIND line but I put it before. I’ll start to use the error trapping too, thanks !!! [;)]