I have 2 tables, 1 stores names and addresses and the other stores additional information about a person. A person can only have one field in the first table but can have up to 2 in the second. The tables are linked by a column in the second table that stores the ID of the person in the first table.
To limit the number of fields a person can add in to the second table, I am trying to create a recordset that will only display an update form if the user has less than 2 fields in the second table.
(ID = the unique ID field in the second table
OwnerID = The ID for the first table stored in the second
colname = session variable)
The query I have tried is;
SELECT ID, OwnerID, count(OwnerID) AS Value
FROM table
WHERE OwnerID = colname AND Value < 3
GROUP BY OwnerID
It displays ok without the 'AND VALUE < 3' But this gives an error when this is included.
Any ideas?