Here are a couple of ideas.
First, put a command button on your form (Labeling it "Login" would be ideal). The checking you need to do could go in the "On Click" event of the button.
Code might be something linke this:
Code:
Dim UserID as String ' could also be numeric
'
' Check that user ID and password are both filled in
'
If isnull(me!username) or isnull(me!PW) then
msgbox "Both user ID and password must be specified"
exit sub
endif
'
' Is user ID valid (does it exist)?
'
if dcount("*","Employee","ID = '" & me!username & "'") = 0 then
msgbox "User ID '" & UserID & "' was not found"
exit sub
endif
'
' User ID exists - is the supplied password correct?
'
if Dlookup("CurrentPW","Employee","ID = '" & me!username & "'") <> me!PW then
msgbox "Incorrect password supplied for User ID '" & me!username & "'"
exit sub
endif
'
' Credentials are ok - retrieve employee name
'
me!Employeename = Dlookup("EmployeeName","Employee","ID = '" & me!username & "'")
'
' Then would follow whatever else you want to to as part of the login procedure
'
Exit Sub
That is a very basic procedure, but it should help you get started. One thing you might do is close the login form and open the application main form, if all the validation checks are passed.
HTH
John