T
Tony Ramirez
From what I got from my responses on the site, I hacked this together. It
isnt working saying I have a missing operator in Query expresion 'Current Job.
This code should look at the field txtJobName in the form, and compare it to
see if the data exists in the Table Current Jobs, Field Current Job.
Could you please help me fix it.
Private Sub Command40_Click()
On Error GoTo ErrHandler
Dim ans As Integer
If (DLookup("Current Job", "[Current Jobs]", "Current Job = '" & _
Me!txtJobName.Value & "'")) Then
ans = MsgBox("GOOD")
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
Was this post helpful
isnt working saying I have a missing operator in Query expresion 'Current Job.
This code should look at the field txtJobName in the form, and compare it to
see if the data exists in the Table Current Jobs, Field Current Job.
Could you please help me fix it.
Private Sub Command40_Click()
On Error GoTo ErrHandler
Dim ans As Integer
If (DLookup("Current Job", "[Current Jobs]", "Current Job = '" & _
Me!txtJobName.Value & "'")) Then
ans = MsgBox("GOOD")
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
Was this post helpful