Dialog Box Query

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I am trying to run a query based on dates pulled from a
form. The query works fine but I want to use the form to
enter the dates when the query is ran. The form contains
two fields. One for a beginning date and one for an
ending date. When I run the query I get two dialog boxes
prompting me for the values instead of the form opening
up. The criteria syntax is:

Is Not Null And Between [Forms]![frmDateRange]!
[BeginningDate] And [Forms]![frmDateRange]![EndingDate]

Should this open the form? If not, is there another way?

Thanks for help in advance.

-Tim
 
No, it won't open the form. The form will have to already be open. Is there
another way? Yes, several. It depends on what you're trying to do. How are
you running the query? If it's for a report, you could open the form in the
report's Open event using the acDialog window mode argument then hide the
form (Visible=False) when you've filled in the values. This will allow the
code to continue running and the data would be there for the query. Close
the form when you close the report.
 
You da' man Wayne! That works well.
Thanks a bunch!
-----Original Message-----
No, it won't open the form. The form will have to already be open. Is there
another way? Yes, several. It depends on what you're trying to do. How are
you running the query? If it's for a report, you could open the form in the
report's Open event using the acDialog window mode argument then hide the
form (Visible=False) when you've filled in the values. This will allow the
code to continue running and the data would be there for the query. Close
the form when you close the report.

--
Wayne Morgan
MS Access MVP


I am trying to run a query based on dates pulled from a
form. The query works fine but I want to use the form to
enter the dates when the query is ran. The form contains
two fields. One for a beginning date and one for an
ending date. When I run the query I get two dialog boxes
prompting me for the values instead of the form opening
up. The criteria syntax is:

Is Not Null And Between [Forms]![frmDateRange]!
[BeginningDate] And [Forms]![frmDateRange]![EndingDate]

Should this open the form? If not, is there another way?

Thanks for help in advance.

-Tim


.
 
Back
Top