D
DS
Is there a better way to code this statement? It works but I'm sure
there might be a better way.
Thanks
DS
Private Sub Image55_Click()
If IsNull(Me.TextD) Then
DoCmd.OpenForm "NoIDENTERED"
Else:
Dim vResult As Long
vResult = Nz(DLookup("[SignedIN]", "[Employees]", "EmployeeID=" &
Me.TextD & "And Active=" & -1), 7)
If vResult = 7 Then
DoCmd.OpenForm "InvalidID"
ElseIf vResult = -1 Then
If Me.TermType = 1 Then
DoCmd.OpenForm "Bar"
DoCmd.Close acForm, "ProServ"
ElseIf Me.TermType = 2 Then
DoCmd.OpenForm "DineIN"
DoCmd.Close acForm, "ProServ"
ElseIf Me.TermType = 3 Then
DoCmd.OpenForm "EatOut"
DoCmd.Close acForm, "ProServ"
End If
ElseIf vResult = 0 Then
DoCmd.OpenForm "NotSignedIN"
End If
End If
Me.Line16.Visible = False
Me.TextD = Null
End Sub
there might be a better way.
Thanks
DS
Private Sub Image55_Click()
If IsNull(Me.TextD) Then
DoCmd.OpenForm "NoIDENTERED"
Else:
Dim vResult As Long
vResult = Nz(DLookup("[SignedIN]", "[Employees]", "EmployeeID=" &
Me.TextD & "And Active=" & -1), 7)
If vResult = 7 Then
DoCmd.OpenForm "InvalidID"
ElseIf vResult = -1 Then
If Me.TermType = 1 Then
DoCmd.OpenForm "Bar"
DoCmd.Close acForm, "ProServ"
ElseIf Me.TermType = 2 Then
DoCmd.OpenForm "DineIN"
DoCmd.Close acForm, "ProServ"
ElseIf Me.TermType = 3 Then
DoCmd.OpenForm "EatOut"
DoCmd.Close acForm, "ProServ"
End If
ElseIf vResult = 0 Then
DoCmd.OpenForm "NotSignedIN"
End If
End If
Me.Line16.Visible = False
Me.TextD = Null
End Sub