A
AngiW
I have 2 tables. Employee Main and Accruals Used. When they select an
employee on the Accruals used form (uses Accruals used table), I want to see if
that employee is eligible to take time (some aren't). I was trying to use an
IF statement, but I can't get it to work since the info that I need to refer to
is in the Employee Main table. I thought it was like table![employee
main]...etc, but that doesn't work either. TIA! Here's the code I tried:
Private Sub EmployeeID_LostFocus()
Dim Msg1, Msg2, Style, Title, Response
Msg1 = "Employee is part time. Not eligible."
Msg2 = "Employee is a casual. Not eligible."
Style = vbOK + vbExclamation
Title = "Error"
If [employee main].Status = "Part time" Then
Response = MsgBox(Msg1, Style, Title)
Else
If [employee main].Status = "casual" Then
Response = MsgBox(Msg2, Style, Title)
End If
End If
End Sub
employee on the Accruals used form (uses Accruals used table), I want to see if
that employee is eligible to take time (some aren't). I was trying to use an
IF statement, but I can't get it to work since the info that I need to refer to
is in the Employee Main table. I thought it was like table![employee
main]...etc, but that doesn't work either. TIA! Here's the code I tried:
Private Sub EmployeeID_LostFocus()
Dim Msg1, Msg2, Style, Title, Response
Msg1 = "Employee is part time. Not eligible."
Msg2 = "Employee is a casual. Not eligible."
Style = vbOK + vbExclamation
Title = "Error"
If [employee main].Status = "Part time" Then
Response = MsgBox(Msg1, Style, Title)
Else
If [employee main].Status = "casual" Then
Response = MsgBox(Msg2, Style, Title)
End If
End If
End Sub