1. include a quit button on your login form to exit the app if user cannot supply correct username and password
2. create a vba function along these lines in the password control afterupdate event (or have another button for the user to click after they have entered their details
private sub txtPassWord_afterUpdate()
dim userRoleID as long
if isnull(txtuserName) or isnull(txtpassWord) then
msgbox "Please complete both fields"
userRoleID=nz(dlookup("RoleID","tblUsers","username='" & txtuserName & "' AND password='" & txtpassWord & "'"),0)
if userRoleID=0 then
msgbox "incorrect username or password, please reenter"
userRoleID is passed to the switchboard form as an openarg value so in your switchboard form open event you might have something like
Select Case OpenArgs