I have this code
I am getting run time error 2471. The expression you entered as a query parameter produced this error 'criteria'
What is wrong here? Also is my syntax correct when comparing the dsum value to the sum of the two dlookup values?
Code:
Private Sub Time_AfterUpdate()
If DSum("Time", "Timelog", "criteria = '" & Forms![Timelog Entry Form]!LotNo & "'") <> _
DLookup("RunTime", "Production and Material Usage Table", "criteria = '" & Forms![Timelog Entry Form]!LotNo & "'") + _
DLookup("Downtime", "Production and Material Usage Table", "criteria = '" & Forms![Timelog Entry Form]!LotNo & "'") Then
MsgBox "Time reported on Timelog and Production report do not match", vbOKOnly
End If
End Sub
I am getting run time error 2471. The expression you entered as a query parameter produced this error 'criteria'
What is wrong here? Also is my syntax correct when comparing the dsum value to the sum of the two dlookup values?