strUsername = Nz(Dlookup ("USERNAME","AUTHORISATION","AUTHORISATION.USERNAME= " & Forms!PASSWORDS.[Text43]),"NoAuth")
If strUserName = "NoAuth" then
msgbox "You have no permission for this"
else
'do stuff
End if
Th nz function looks for spaces, nulls and otherwise blank data and enables you...