Using Access 2000
The SQL for the crosstab query is
I am trying to open a report based on a Crosstab query, from a form.
The form is an unbound form called frmDateSelector. It has a txtStartDate in which to enter the Start Date for the period, and txtEndDate in which to enter the End Date for the period.
Behind a command button to preview the report is the following code...
This results in "Forms!frmDateSelector!txtStartDate is not recognized as a valid field name or expression."
When I try to change the dates in bold in the SQL above, to "Between [Forms]![frmDateSelector]![txtStartDate] And [Forms]![frmDateSelector]![txtEndDate]" the same error results.
A push in the right direction would be appreciated.
Thanks.
Tom
The SQL for the crosstab query is
Code:
TRANSFORM Count(tblAttendance.Present) AS CountOfPresent
SELECT tblMembers.MemberID, [LastName] & ", " & [FirstName] AS FullName, Count(tblAttendance.MeetingDate) AS [Meetings Attended]
FROM tblMembers LEFT JOIN tblAttendance ON tblMembers.MemberID = tblAttendance.MemberID
WHERE (((tblMembers.Status)<>"Deceased" And (tblMembers.Status)<>"Transferred Out") AND ((tblAttendance.Present)=Yes) AND ((tblAttendance.MeetingDate) [b]Between #11/13/2008# And #11/20/2008#))[/b]
GROUP BY tblMembers.MemberID, [LastName] & ", " & [FirstName], tblMembers.Status
ORDER BY [LastName] & ", " & [FirstName], Format([MeetingDate],"mmm dd, yyyy")
PIVOT Format([MeetingDate],"mmm dd, yyyy");
I am trying to open a report based on a Crosstab query, from a form.
The form is an unbound form called frmDateSelector. It has a txtStartDate in which to enter the Start Date for the period, and txtEndDate in which to enter the End Date for the period.
Behind a command button to preview the report is the following code...
Code:
DoCmd.OpenReport "rptAttendanceTotalsForPeriod", acViewPreview, , "[MeetingDate] Between #" & Forms!frmDateSelector!txtStartDate & "# AND #" & Forms!frmDateSelector!txtEndDate & "#"
This results in "Forms!frmDateSelector!txtStartDate is not recognized as a valid field name or expression."
When I try to change the dates in bold in the SQL above, to "Between [Forms]![frmDateSelector]![txtStartDate] And [Forms]![frmDateSelector]![txtEndDate]" the same error results.
A push in the right direction would be appreciated.
Thanks.
Tom