I am still a novice user of Access so forgive me if I am not as immediate with procuring the information that you are requesting. Please do not hesitate to request additional information! Thank you for your help.
This is what is have setup in my Macros:
Command80 is a button I used to clear the fields and go to the newest record.
List85 is where names will show up when they sign in.
SignIn is my Sign in button
Sign_Out is my sign out button
Code:
Option Compare Database
Private Sub Command80_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub Form_Load()
DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub List85_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me!
[List85], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub SignIn_Click()
' perform data validation
If (IsNull(Me.FirstName)) Then
MsgBox "You must enter your first name."
Cancel = True
Exit Sub
ElseIf (IsNull(Me.LastName)) Then
MsgBox "You must enter your last name."
Cancel = True
Exit Sub
End If
Dim bolOK As Boolean
bolOK = Nz(Me.Reason1, False) Or _
Nz(Me.Reason2, False) Or _
Nz(Me.Reason3, False) Or _
Nz(Me.Reason4, False) Or _
Nz(Me.Reason5, False) Or _
Nz(Me.Reason6, False)
If Not bolOK Then
bolOK = (Trim(Me.ReasonOther & "") <> "")
End If
If Not bolOK Then
Cancel = True
MsgBox "You must select at least one checkbox from the 'Reason for vist' list " & _
"or type your reason in the 'Other Reason' field."
Exit Sub
End If
If bolOK Then
bolOK = Nz(Me.Association1, False) Or _
Nz(Me.Association2, False) Or _
Nz(Me.Association3, False) Or _
Nz(Me.Association4, False) Or _
Nz(Me.Association5, False)
If Not bolOK Then
Cancel = True
MsgBox "You must select at least one checkbox from the 'Associations' list."
Exit Sub
End If
End If
Me.TimeIn = Time
On Error GoTo Err_SignIn_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.GoToRecord , , acNewRec
'Refresh List
List85.Requery
Exit_SignIn_Click:
Exit Sub
Err_SignIn_Click:
MsgBox Err.Description
Resume Exit_SignIn_Click
End Sub
Private Sub Sign_Out_Click()
' perform data validation
If (IsNull(Me.TimeIn)) Then
MsgBox "You must sign in before you can sign out."
Cancel = True
Exit Sub
End If
Me.TimeOut = Time
On Error GoTo Err_Sign_Out_Click
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.GoToRecord , , acNewRec
'Refresh List
List85.Requery
Exit_Sign_Out_Click:
Exit Sub
Err_Sign_Out_Click:
MsgBox Err.Description
Resume Exit_Sign_Out_Click
End Sub