I am trying to write a crosstab query in Access97 that
will allow me to use form fields as criteria for limiting
the values calculated. I have created a form that has a
drop down box that calculates date ranges based off of
predetermined criteria. What I would like is a way that
the user can select a date rang from this list and press a
button to view the crosstab query. I have tried something
like:
TRANSFORM Count(tblNotebook.Key) AS [The Value]
SELECT tblNotebook.BookScannedBy
FROM tblNotebook
WHERE (((tblNotebook.BookScannedBy) Is Not Null) AND
((tblNotebook.BookScanned)=True) AND
((tblNotebook.BookScannedDate) Between [Forms]!
[frmNotebookScanTOCReport]![txtDate1] And [Forms]!
[frmNotebookScanTOCReport]![txtDate2]))
GROUP BY tblNotebook.BookScannedBy
PIVOT tblNotebook.BookScanned;
but get an error that the jet engine does not recognize my
form fields. I could write the query dynamically in the
VBA code behind the button filling in the dates but then
what? Now that I have the SQL statement, how do I show the
results to the user? Or even better... How can I use the
results on a report. If anyone has any ideas or even
understands my question I would appreciate their help.
Thank you in advance.
will allow me to use form fields as criteria for limiting
the values calculated. I have created a form that has a
drop down box that calculates date ranges based off of
predetermined criteria. What I would like is a way that
the user can select a date rang from this list and press a
button to view the crosstab query. I have tried something
like:
TRANSFORM Count(tblNotebook.Key) AS [The Value]
SELECT tblNotebook.BookScannedBy
FROM tblNotebook
WHERE (((tblNotebook.BookScannedBy) Is Not Null) AND
((tblNotebook.BookScanned)=True) AND
((tblNotebook.BookScannedDate) Between [Forms]!
[frmNotebookScanTOCReport]![txtDate1] And [Forms]!
[frmNotebookScanTOCReport]![txtDate2]))
GROUP BY tblNotebook.BookScannedBy
PIVOT tblNotebook.BookScanned;
but get an error that the jet engine does not recognize my
form fields. I could write the query dynamically in the
VBA code behind the button filling in the dates but then
what? Now that I have the SQL statement, how do I show the
results to the user? Or even better... How can I use the
results on a report. If anyone has any ideas or even
understands my question I would appreciate their help.
Thank you in advance.