It is the image.
I placed an image and a button on a continuous form, each with a click event to MsgBox the record ID.
Clicking image only picks up the ID of the first record, whichever record is clicked.
Clicking Button shows correct ID as expected.
What happens if DaysLeft = 0 ?
I guess you could also use:
SELECT
t.Status,
COUNT(*) AS [Count]
FROM (
SELECT
IIf(Days left >= 0, 'Valid', 'Invalid') AS Status
FROM AllDeliveredQ
) t
GROUP BY
t.Status
;
One thing to double-check:
With table [Date calc] in design view, what datatypes are DueDate and DatePaid ?
Or if [Date calc] is a query, what is the SQL of the query?
Switch you query to SQL view.
Copy and paste the SQL here.
We can show you the corrected SQL.
Then you can paste it over the SQL of your query.
Then switch back to query view and you will see how it is constructed by Access in the query designer.