Code:
Set rs1 = db.OpenRecordset("SELECT tblOrders.orderDeliveryDate, tblOrders.orderDropNumber,
Count(tblOrders.orderDropNumber) AS CountOforderDropNumber FROM tblContacts INNER JOIN tblOrders ON
tblContacts.contactID = tblOrders.contactID GROUP BY tblOrders.orderDeliveryDate, tblOrders.orderDropNumber
Where tblOrders.orderDeliveryDate=[forms]![frmCollectDates].[txtStartDate]")
I think the issue is with the value from Forms.... The value is within your OpenRecordSet string. It looks like some constant to Access.
You have to let the [forms]![frmCollectDates].[txtStartDate] get evaluated and then appended to the OpenRecordSet string.
Something like this (UNTESTED)
Code:
Set rs1 = db.OpenRecordset("SELECT tblOrders.orderDeliveryDate, tblOrders.orderDropNumber,
Count(tblOrders.orderDropNumber) AS CountOforderDropNumber FROM tblContacts INNER JOIN tblOrders ON
tblContacts.contactID = tblOrders.contactID GROUP BY tblOrders.orderDeliveryDate, tblOrders.orderDropNumber Where
tblOrders.orderDeliveryDate= #" &[forms]![frmCollectDates].[txtStartDate] & "#")
You may have to tweak the statement depending on txtStartDate definition.
Access usually wants Dates delimited with #, but if your txtStartDate is string, you may need to replace # with single quote,
or you may need to use the CDate() function.