What your trying to accomplish is fairly simple. Later you can crank it up a notch like we suggested.
Make a table calle tblPasswords for example.
In this table you can have two fields called UserName and PassWord.
Offcourse you put the login credentials in this table, like in your example
Test@Test.com in your the field UserName and in the Password field the word Test.
Lets assume your Login form is called frmLogin and the two controls on this form ctrlUsername and ctrlPassword.
code is as follows :
Code:
'Check if the password field is not empty
If Len(Nz(Me!ctrlPassword, "")) = 0 Then
MsgBox "Password is required", _
vbInformation, "Missing password"
Me.ctrlPassword.SetFocus
Exit Sub
End If
'the same code can be used to check if the username is empty.
if DLookup("Password", "tblPasswords", "[Username] = '" & Me[.ctrlUserName].Value & "'") = me.ctrlPassWord.value then
DoCmd.OpenForm "frmYourForm"
else
MsgBox "Wrong Password", _
vbInformation, "Password notification"
Me.ctrlPassword.SetFocus
Exit Sub
End If
If your users all use their own computer, a more userfriendly way is to use the network or computername.
You can fetch this information failry simple using =FOSusername()