I have a crosstab query, sql below
It gives me an error message:
It does this because the parameter needs to be explicitly defined. When I do that, I have the following sql
And then when I run the query from a Report, I first get the parameter prompts (one for txtStart, and one for txtEnd) and then I get the form dialog box to input the same criteria. This is quite annoying - having to enter the same criteria twice. I want to use the form and not the prompts.
Is there a way to have the form dialog box and NOT have the prompts?
Code:
TRANSFORM Count(qryNONMembers.LocW) AS CountOfLocW
SELECT qryUnionProgramDates.FirstOfMth, qryNONMembers.LocW
FROM qryNONMembers LEFT JOIN qryUnionProgramDates ON qryNONMembers.PID = qryUnionProgramDates.pid
WHERE (((qryUnionProgramDates.FirstOfMth) Between ([Forms]![fdlgNONMemProgParticipants]![txtStart]) And ([Forms]![fdlgNONMemProgParticipants]![txtEnd])))
GROUP BY qryUnionProgramDates.FirstOfMth, qryNONMembers.LocW
ORDER BY qryUnionProgramDates.FirstOfMth
PIVOT qryNONMembers.Mtype;
It gives me an error message:
Code:
The Microsoft Jet database engine does not recognize '[Forms]![fdlgNONMemProgParticipants]![txtStart]' as a valid field name or expression.
It does this because the parameter needs to be explicitly defined. When I do that, I have the following sql
Code:
PARAMETERS [Forms]![fdlgNONMemProgParticipants]![txtStart] DateTime, [Forms]![fdlgNONMemProgParticipants]![txtEnd] DateTime;
TRANSFORM Count(qryNONMembers.LocW) AS CountOfLocW
SELECT qryUnionProgramDates.FirstOfMth, qryNONMembers.LocW
FROM qryNONMembers LEFT JOIN qryUnionProgramDates ON qryNONMembers.PID = qryUnionProgramDates.pid
WHERE (((qryUnionProgramDates.FirstOfMth) Between ([Forms]![fdlgNONMemProgParticipants]![txtStart]) And ([Forms]![fdlgNONMemProgParticipants]![txtEnd])))
GROUP BY qryUnionProgramDates.FirstOfMth, qryNONMembers.LocW
ORDER BY qryUnionProgramDates.FirstOfMth
PIVOT qryNONMembers.Mtype;
And then when I run the query from a Report, I first get the parameter prompts (one for txtStart, and one for txtEnd) and then I get the form dialog box to input the same criteria. This is quite annoying - having to enter the same criteria twice. I want to use the form and not the prompts.
Is there a way to have the form dialog box and NOT have the prompts?