potatohead
Registered User.
- Local time
- Today, 03:47
- Joined
- Dec 23, 2005
- Messages
- 10
Hi All
I currently have a log on form that checks a users password against passwords in a table, before opening a form at that users record. Ie, If Fred Bloggs logged in with password FRED, the next form would open at Fred Bloggs' record.
I've used the following code:
Private Sub cmdOK_Click()
Dim stDocName As String
Dim stLinkCriteria As String
If Me.ConfirmPassword = Me.UserPassword Then
stDocName = "frmEditUser"
stLinkCriteria = "[UserID]=" & Me![UserID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmUserPassword"
Forms!frmEditUser.SetFocus
Else
MsgBox " Password Incorrect. ", vbExclamation
Me.ConfirmPassword = ""
Me.ConfirmPassword.SetFocus
End If
However, when hitting the OK Button (with the correct details in), a pop up window appears saying "Enter Parameter Value", if I were to enter Fred Bloggs again, then the relevant record would appear, but if not, then the first record would appear.
Is there anyway for this 'Enter Paramter' window NOT to appear?
Many thanks
I currently have a log on form that checks a users password against passwords in a table, before opening a form at that users record. Ie, If Fred Bloggs logged in with password FRED, the next form would open at Fred Bloggs' record.
I've used the following code:
Private Sub cmdOK_Click()
Dim stDocName As String
Dim stLinkCriteria As String
If Me.ConfirmPassword = Me.UserPassword Then
stDocName = "frmEditUser"
stLinkCriteria = "[UserID]=" & Me![UserID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmUserPassword"
Forms!frmEditUser.SetFocus
Else
MsgBox " Password Incorrect. ", vbExclamation
Me.ConfirmPassword = ""
Me.ConfirmPassword.SetFocus
End If
However, when hitting the OK Button (with the correct details in), a pop up window appears saying "Enter Parameter Value", if I were to enter Fred Bloggs again, then the relevant record would appear, but if not, then the first record would appear.
Is there anyway for this 'Enter Paramter' window NOT to appear?
Many thanks