I am trying to get the number of records between two dates and put the result into a text box on the same form as the start date and end date. I can do this in a report, but I am stumped on how to achieve the result in a text box. I am using the following SQL to counts the records,
SELECT DISTINCTROW Count(*) AS [No of Internal] FROM Nonconformances WHERE (((Nonconformances.DateRaised) Between [forms]![frmReports]![StartDate] And [forms]![frmReports]![EndDate]) AND ((Nonconformances.[C or I])="I"));
I have tried putting the SQL into the contol source of the text box but just get a Name error. Any suggestions please.