DCount with variable as criteria

Im using the DCount function to check if a record exists in a table. Firstly i set a variable "Item" to a number. Then i use the following code:
DCount("[ItemID]", "OrderIn", "[ItemID] = Item")
The table i want the function to check is called, OrderIn
The field can be any but i have just so happen to have choosen ItemID
The criteria is where ItemID = item (which is a number)

I get an error message saying "The expression you entered as a query perameter produced the following error: 'Item'"

Any ideas why this doesnt work.

Who is Participating?
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
DCount("[ItemID]", "OrderIn", "[ItemID] = " & Item & "")
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.