query criteria from form

Wesley Morgan

Registered User.
Local time
Today, 10:49
Joined
Aug 18, 2003
Messages
17
I am trying to use a form to set the start date and end date for a crosstab query. The form has two unbound text boxes each named begin date and end date. The query has the following criteria " Between [Forms]![form name]![begin date] and [Forms]![form name]![end date].
I get the following error if I run the query. "The Microsoft Jet database engine does not recognize [Forms]![form name]![begin date] as a valid field or expression.
What am I missing.
 
Rich,
I tried this and still get the same error. I set parameters for begin date and end date to date/time. get the same error.
 
Rich,
This is the SQL for the query. I am trying to create a switchboard to select different reports. The report based upon a date range would call a form to allow operator to input the begin date and end date. The form would set the criteria for the query and have a command button to preview report. Any help would be great.
Thank you,
Wesley Morgan

PARAMETERS [begin] DateTime, [end] DateTime;
TRANSFORM Avg(FloatTable.Val) AS AvgOfVal
SELECT FloatTable.DateAndTime
FROM FloatTable INNER JOIN TagTable ON FloatTable.TagIndex = TagTable.TagIndex
WHERE (((FloatTable.DateAndTime) Between [Forms]![Report Date Range]![begin] And [Forms]![Report Date Range]![end]))
GROUP BY FloatTable.DateAndTime
PIVOT TagTable.TagIndex;
 
Last edited:
if Begin and End are controls on the form there is no need to use Parameters

Or if you want to use parameters you must delete the reference to the form....

Also, dont use spaces in you form names (or any special characters like / ? * etc) it will hurt you in the future!

Regards
 
The problem seems to be in the form. If I change the text box name on the form the change carries over to the query criteria. This tells me that the form name is being accepted. The text box name is not being recognized as a valid field. Should I do something different. Can someone take the time to explain how to build a form in design view to allow operator to input begin date and end dates into the criteria of a query for a report based upon that query and a date range. I have tried several things and get the same error. The Microsoft Jet database engine does not recognize the text box name as a valid field.
Please help!
Wesley Morgan
 
I have solved problem. I am using linked tables in my database. I set a build table query and moved all data to new table. Form and report work great with new query. The question now becomes "Will the build table query update as needed to allow the crosstab query to work?" We shall find out.
Thanks for the help. If anyone has information that might polish this report,form,query project send it to me.
Wesley Morgan
 

Users who are viewing this thread

Back
Top Bottom