How to use different value from select options vs what's displayed? Name vs Realname
Having changed it to $account->name I managed to find out what's going using devel command dpr($variable) which contained the users uid.

Then I just needed to replace the user lookup query accordingly to cross check from realname table with that of the users based on uid.

$query = db_select('realname','rn');
$query-&gt;join('users','usr','usr.uid=rn.uid');
$query-&gt;fields('rn', array('uid'));
$query-&gt;condition('rn.realname',$mail,'=');
$result =$query-&gt;execute()-&gt;fetchAll();

if (!empty($result)) {
$uids =array($result[0]-&gt;uid);
$account = user_load_multiple($uids);
$account = array_shift($account);
}