Private Sub TextBoxName_Click()
Static Counter As Integer
If txtPassword = "123" Then
DoCmd.OpenForm "Employees", acNormal, "", "", , acNormal
Else
If txtPassword = "ABC" Then
DoCmd.OpenForm "Customers", acNormal, "", "", , acNormal
Else
If txtPassword = "XXX" Then
DoCmd.OpenForm "Products", acNormal, "", "", , acNormal
Else
If Counter < 2 Then
MsgBox "The password you entered is not correct - try again - MAX 3
ATTEMPTS?", vbOKOnly, "Database entry declined"
Counter = Counter + 1
txtPassword = ""
Else
DoCmd.Quit
End If
End If
End If
End Sub
Change textBoxName to what it really is
You can delete this bit if you want (but I would leave it on)
If Counter < 2 Then
MsgBox "The password you entered is not correct - try again - MAX 3
ATTEMPTS?", vbOKOnly, "Database entry declined"
Counter = Counter + 1
txtPassword = ""
Hope this helps

Signature
Wayne
Manchester, England.
> Hi
>
[quoted text clipped - 16 lines]
>
> thanks for your help
Pieter Wijnen - 17 Sep 2007 16:08 GMT
"Prettier" is
Select Case Me.txtPassword.Value
Case "123"
DoCmd.OpenForm "Employees", acNormal
Case "ABC"
DoCmd.OpenForm "Customers"", acNormal
Case Else
MsgBox "Invalid Password"
End Select
HTH
Pieter
> Private Sub TextBoxName_Click()
> Static Counter As Integer
[quoted text clipped - 50 lines]
>>
>> thanks for your help