Restrict IMPORT / DROP DOWN list by other FORM data

Restrict IMPORT / DROP DOWN list by other FORM data

I am trying to restrict a drop down list by a valaue in another field on the FORM data entry page. 
 
General info:
FORM NAME
CATEGORY
FIELDS - TYPE
CATEGORY - FREE TEXT
 
FORM NAME
DEVALCODES
FIELDS - TYPE
DEVALCODE - FREE TEXT
CATEGORY - DROPDOWN IMPORT FROM CATEGORY FORM
 
FORM NAME
ASSETS
FIELDS - TYPE
CATEGORY - DROPDOWN IMPORT from CATEGORIES form
DEVALCODE - DROPDOWN IMPORT from DEVALCODES form
 
Goal
Restrict DEVALCODE dropdown list by CATEGORY as selected in ASSETS form.
 
 
However, I cannot work out how to restrict based on the value in another input field.
 
In Field properties under Set Criteria I have tried the following to reference to the field by CATEGORY==INPUT.CATEGORY but this doesn't work.  I get the error Error at line:0 Variable 'this' is not declared
 
I have tried to set a variable in script on input for the CATEGORY field as  set CATREF=input.CATEGORY and then referring to this as above by CATEGORY==CATREF ... this yields an error at line:0 Field CATREF does not exist in form DEVALCODES 
 
Simply put I wish to restrict a lookup list by the value entered in another lookup on the same form.  Seems like a reasonable request.
 
Any help apprecaited.
Regards
Stu