query problem with unbound form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a query that I run with criteria from fields in an unbound form.
When I run the query with the form closed, it asked for the data that would
come from the fields in the form, I enter the data, and the query works
fine. When I run the query with the form open with the same data entered
into the fields, the query does not ask for the data, but it also does not
find any records. The data in the form is a from and to date, the format of
the field is short date. What is wrong with the query?

thanks for any help

copied from sql view below

SELECT Clients.[CL-PK Client ID], Clients.[CL Last SV Visit], [CC PCS
Authorized Units].[AU-FK Proc ID], Frequency.Frequency, Frequency.[Interval
in Months], DateAdd("m",[Interval in Months],[CL Last SV Visit]) AS
NextVisit, [CC PCS Authorized Units].[AU From Date], [CC PCS Authorized
Units].[AU To Date]
FROM ([CC PCS Authorized Units] INNER JOIN Clients ON [CC PCS Authorized
Units].[AU-FK Client ID] = Clients.[CL-PK Client ID]) INNER JOIN Frequency
ON [CC PCS Authorized Units].[AU-FK Frequency Code] = Frequency.[FREQ-PK
Frequency Code]
WHERE ((([CC PCS Authorized Units].[AU-FK Proc ID])="T1001") AND
((DateAdd("m",[Interval in Months],[CL Last SV Visit]))<=[au to date]) AND
(([CC PCS Authorized Units].[AU From Date]) Between
[forms]![frmqryparametersfromto]![txtFromDate] And
[forms]![frmqryparametersfromto]![txToDate])) OR ((([CC PCS Authorized
Units].[AU-FK Proc ID])="T1001") AND ((DateAdd("m",[Interval in Months],[CL
Last SV Visit]))<=[au to date]) AND (([CC PCS Authorized Units].[AU To
Date]) Between [forms]![frmqryparametersfromto]![txtFromDate] And
[forms]![frmqryparametersfromto]![txToDate])) OR ((([CC PCS Authorized
Units].[AU-FK Proc ID])="G9001") AND ((DateAdd("m",[Interval in Months],[CL
Last SV Visit]))<=[au to date]) AND (([CC PCS Authorized Units].[AU From
Date]) Between [forms]![frmqryparametersfromto]![txtFromDate] And
[forms]![frmqryparametersfromto]![txToDate])) OR ((([CC PCS Authorized
Units].[AU-FK Proc ID])="G9001") AND ((DateAdd("m",[Interval in Months],[CL
Last SV Visit]))<=[au to date]) AND (([CC PCS Authorized Units].[AU To
Date]) Between [forms]![frmqryparametersfromto]![txtFromDate] And
[forms]![frmqryparametersfromto]![txToDate]))
ORDER BY DateAdd("m",[Interval in Months],[CL Last SV Visit]);



.



Relevant Pages

  • RE: Filtering a subform using many combo boxes
    ... SELECT AssignedPriority, AssignedPriorityDetail FROM tblAssignedPriority ... YES for all of the combo boxes.) ... I followed you instructions to the letter and every one of the criteria ... open the query "qryProjects" in design view. ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... Candia Computer Consulting - Candia NH ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... Candia Computer Consulting - Candia NH ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)
  • RE: Filtering a subform using many combo boxes
    ... I followed you instructions to the letter and every one of the criteria ... I described the typical properties of all my combo boxes in my original ... open the query "qryProjects" in design view. ... I have a main table named tblProjectData that contains all the data for each ...
    (microsoft.public.access.forms)
  • Re: using a form with combo box to input criteria
    ... When you removed the criteria, ... Then your criteria in the query would be... ... query behind your main report. ...
    (microsoft.public.access.forms)