I want to use a DCount function in a beforeupdate to check on the number of entries in my table (and display a warning when a maximum is reached on entries with a specific ID).
Using DCount in the beforeupdate without criteria returns the correct total number of records in my table as follows:
DCount("[Id]", "Roster").
When I add the criteria to this which is a value from a field on the form it looks like this:
DCount("[Id]", "Roster", "[Id] = Form![Workshop]")
When I display the value of Form![Workshop] it shows the correct numeric value that I want to select on. But for some reason this DCount always returns 1?
What am I doing wrong?
Using DCount in the beforeupdate without criteria returns the correct total number of records in my table as follows:
DCount("[Id]", "Roster").
When I add the criteria to this which is a value from a field on the form it looks like this:
DCount("[Id]", "Roster", "[Id] = Form![Workshop]")
When I display the value of Form![Workshop] it shows the correct numeric value that I want to select on. But for some reason this DCount always returns 1?
What am I doing wrong?