So I have this hand-me down Access document which is a SignIn SignOut tracker. Unfortunately at some part in this code when you go to sign out it will sign out anyone instead of specifically signing out the requested person. Where is the issue? I will do whatever is required to get some help with this. Thanks a lot.
Code:
Option Compare Database
Private Sub Name_Last_AfterUpdate()
End Sub
Private Sub Sign_In_Exit(Cancel As Integer)
Dim MyNow
MyNow = Now
Sign_In = MyNow
End Sub
Private Sub cmdCloseForm_Click()
DoCmd.Close
End Sub
Private Sub Combo59_GotFocus()
Me.Combo59.SetFocus
End Sub
Private Sub Combo59_LostFocus()
End Sub
Private Sub Form_AfterInsert()
End Sub
Private Sub Name_Last_List_Box_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Name_Last_List_Box] & "'"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
Else
Me.Combo59 = ""
End If
End Sub
Private Sub Form_Current()
Me.Combo59.SetFocus
End Sub
Private Sub Sign_Out_Button_Click()
On Error GoTo Err_Sign_Out_Button_Click
If Me.Combo59 Is Null Or Me.Combo59 = "" Then
DoCmd.Close
Else
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Combo59] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
If Me.Elec_Device = "YES" Then
DoCmd.OpenForm "ElecDeviceReminder", acNormal
Else
DoCmd.Close
End If
End If
Exit_Sign_Out_Button_Click:
Exit Sub
Err_Sign_Out_Button_Click:
If Me.Combo59 = "" Then
DoCmd.Close
Else
Me.Combo59.LimitToList = False
Me.Combo59 = ""
If Me.Combo59 = "" Then
DoCmd.Close
Else
MsgBox Err.Description
Resume Exit_Sign_Out_Button_Click
End If
End If
End Sub
Private Sub Combo32_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Combo32] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo34_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Combo34] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo40_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Combo40] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub List42_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me!
[List42] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub List44_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me!
[List44] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub List49_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me!
[List49] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Sign_Out_Exit_Button_Click()
On Error GoTo Err_Sign_Out_Exit_Button_Click
DoCmd.Close
Exit_Sign_Out_Exit_Button_Click:
Exit Sub
Err_Sign_Out_Exit_Button_Click:
MsgBox Err.Description
Resume Exit_Sign_Out_Exit_Button_Click
End Sub
Private Sub Text52_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Combo59_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name_Last] = '" & Me![Combo59] & "'"
If Me.Combo59 = "" Then
Else
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
Me.Sign_Out = Me.SignOutDate
Me.Sign_Out_Button.SetFocus
Else
Me.Combo59 = ""
End If
End If
End Sub