Single Quotes in Filter

eYeeYe Member Posts: 168
I have the following Code:
gRecWarehouseEmp.RESET;
gRecWarehouseEmp.SETRANGE("User ID", USERID);

IF NOT gRecWarehouseEmp.FINDFIRST THEN
 ERROR(Text001, USERID)
ELSE
 BEGIN
//   FILTERGROUP(10);
   SETFILTER("Location Code", '%1', GetLocation());
   IF FINDFIRST THEN;
//  FILTERGROUP(0);
 END;

With function: GetLocation() : Text[1024]
lLocationFilter := gRecWarehouseEmp."Location Code";
IF gRecWarehouseEmp.NEXT <> 0 THEN
 EXIT(lLocationFilter + '|' + GetLocation());

EXIT(lLocationFilter);

What it does is look through the warehouse employee table, and append the location codes to form a filter. But for some reason when I open the form, my filters come out with single quotes:

Field Filter
Location Code 'CTN|JHB'

instead of:

Field Filter
Location Code CTN|JHB

How can I fix this?[/b]
Kind Regards,
Ewald Venter

Answers

Sign In or Register to comment.