Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error in DCOUNT statement 1

Status
Not open for further replies.

Smoothcat74

Technical User
Aug 29, 2008
40
I'm losing my mind. I'm getting Syntax error (Missing operator) in query expression '[EmpCod] =' yet for the life of me, I don't see where that syntax error is! Can someone please help??

Code:
ProdReport.MoveFirst
Do While Not ProdReport.EOF
    If DCount("*", "EmployeeCodes", "[EmpCod] =" & ProdReport!EmployeeID) = 0 Then
        CountBad = CountBad + 1
        ProdReport.MoveNext
    Else
        CountGood = CountGood + 1
    End If
ProdReport.MoveNext
Loop
 
Code:
If DCount("*", "EmployeeCodes", "[EmpCod] =" & [!]Nz([/!]ProdReport!EmployeeID[!], 0)[/!]) = 0 Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That worked like a charm!! Thank you kindly PHV! You rock!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top