Since my original post and fantastic assistance I received, this feature has been working great for me. However, this morning, I split my database. I placed the backend on our network and kept the frontend on my desktop. Then I took the frontend and changed it to the MDE format. (So far so good)
I selected my protected form and my Enter Password box popped up correctly. I entered my password and clicked on the Enter button. Then I received the following message,
"Error 3219" Invalid Operation. (Note: I can select ok and it accepts password)
I've been GoogleSofting and think it might have something to do with this,
PRB: Jet Doesn't Support QueryDefs on a Non-Attached ODBC Table
Article ID : 149055
Last Review : March 14, 2005
Revision : 2.2
The code for my Login module is;
Public MyPassword
Public Function KeyCode(Password As String) As Long
' This function will produce a unique key for the
' string that is passed in as the Password.
Dim I As Integer
Dim Hold As Long
For I = 1 To Len(Password)
Select Case (Asc(Left(Password, 1)) * I) Mod 4
Case Is = 0
Hold = Hold + (Asc(Mid(Password, I, 1)) * I)
Case Is = 1
Hold = Hold - (Asc(Mid(Password, I, 1)) * I)
Case Is = 2
Hold = Hold + (Asc(Mid(Password, I, 1)) * _
(I - Asc(Mid(Password, I, 1))))
Case Is = 3
Hold = Hold - (Asc(Mid(Password, I, 1)) * _
(I + Len(Password)))
End Select
Next I
KeyCode = Hold
End Function
Code for my Password Form is,
Private Sub CheckPassword_Click()
If IsNull(Forms!frmPassword!Text0.Value) Then
MsgBox "You cannot enter a blank Password. Try again."
Me!Text0.SetFocus
Else
MyPassword = Me!Text0.Value
DoCmd.Close acForm, "frmPassword"
End If
End Sub
Any suggestions?