TFrmNames is a class. That class inherits from something (probably a form) that defines "name" as property.
Since the class scope is deeper nested than the unit scope that defines the global variable, The property in the class is accessed, and that doesn't have the field, causing the error.
Solution:
specify you want the name variable in the unit scope, by prefixing it with unitname. so
unitname.name.title:='Mr';
if your unit is called "unitname"