Dan89
asked on
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.
Thanks
Dan
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.
Thanks
Dan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.