|
-
Feb 20th, 2004, 12:25 PM
#3
Thread Starter
New Member
Coding
OOps....Sorry bout that...
Private Sub Ctl10_1_1_Enter()
Dim strInputPin As String
If Ctl10_1_1 <> "" Then
strInputPin = InputBox("Unlock with original signer's pin:")
Dim rsCheck As ADODB.Recordset
Set rsCheck = New ADODB.Recordset
rsCheck.ActiveConnection = CurrentProject.Connection
rsCheck.CursorType = adOpenKeyset
rsCheck.LockType = adLockOptimistic
rsCheck.Open "Select * From tblTrainerSignOffs"
rsCheck.Find "[strName] = '" & Ctl10_1_1 & "'"
If rsCheck!strPin = strInputPin Then
MsgBox ("Sign-off unlocked.")
Else
MsgBox ("Pin did not match. Stop cheating.")
GoTo 998
End If
rsCheck.Close
Set rsCheck = Nothing
Else
End If
strInputPin = InputBox("Enter Sign-Off Pin:")
Dim rsUsers As ADODB.Recordset
Set rsUsers = New ADODB.Recordset
rsUsers.ActiveConnection = CurrentProject.Connection
rsUsers.CursorType = adOpenKeyset
rsUsers.LockType = adLockOptimistic
rsUsers.Open "Select * From tblTrainerSignOffs"
rsUsers.MoveFirst
Do Until rsUsers.EOF
If rsUsers!strPin = strInputPin Then
Ctl10_1_1 = rsUsers!strName
GoTo 999
Else
rsUsers.MoveNext
End If
Loop
999 rsUsers.Close
Set rsUsers = Nothing
998 [Command34].SetFocus
DoCmd.RunCommand (acCmdRefresh)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|