T
Tony Ramirez
I want the following code to evaluate txtJobName in my current form and
compare it to the value of current job in the table Current Jobs. If it finds
the match then I want it to run another Private Sub, if not it should return
the error message (which I am pretty sure is working). Could someone please
help me finish it. Thanks so much for your help. Tony
Private Sub Command39_Click()
On Error GoTo ErrHandler
Dim ans As Integer
If (DLookup("Current Job", "[Current Jobs]", "Current Job = '" & _
Me!txtJobName.Value & "'") = ?????) Then
Dim stDocName As String
Would Like To Run Another Private Sub Like -- Private Sub
Command15_Click()
Else
ans = MsgBox("You are not currently not clocked into this job.
Please check your daily activity by clicking the Current button." & vbCrLf & _
"Click OK to continue", _
vbInformation + vbOKOnly, "Employee Not Available")
If (ans = vbYes) Then
' Do something else.
End If
End If
Exit Sub
ErrHandler:
MsgBox "Error in RunQueryBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Sub
compare it to the value of current job in the table Current Jobs. If it finds
the match then I want it to run another Private Sub, if not it should return
the error message (which I am pretty sure is working). Could someone please
help me finish it. Thanks so much for your help. Tony
Private Sub Command39_Click()
On Error GoTo ErrHandler
Dim ans As Integer
If (DLookup("Current Job", "[Current Jobs]", "Current Job = '" & _
Me!txtJobName.Value & "'") = ?????) Then
Dim stDocName As String
Would Like To Run Another Private Sub Like -- Private Sub
Command15_Click()
Else
ans = MsgBox("You are not currently not clocked into this job.
Please check your daily activity by clicking the Current button." & vbCrLf & _
"Click OK to continue", _
vbInformation + vbOKOnly, "Employee Not Available")
If (ans = vbYes) Then
' Do something else.
End If
End If
Exit Sub
ErrHandler:
MsgBox "Error in RunQueryBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear
End Sub