Connecting Text Box in Query Criteria

  • Thread starter Thread starter Ms-Exl-Learner
  • Start date Start date
M

Ms-Exl-Learner

I have created a Select query for retrieving some particular Date Records
from a table using the BETWEEN expression in query criteria bymentioning the
From Date and To Date and it’s working fine.

Each time I don’t want to open the query and enter the From Date and To
Date, so I want to create TWO Unbound text box in Forms for entering the From
Date and To Date and nearby the text box I am having a command button to run
the query.

Now I want to know how I can connect the Two Unbound Text Boxes that is From
Date and TO_DATE which is created in Forms in the Select Query (BETWEEN). I
want the select query to pick the From date and To Date from the form text
boxes and run the query.

Hope someone will give your valuable suggestion.
 
Use Forms![NameOfForm]![From_Date] and Forms![NameOfForm]![To_Date] as the
parameters in your query.
 
Between [Forms]![frmParameter2]![From Date] AND [Forms]![frmParameter2]![To
Date] + .99999

The form must remain open, but can be invisible for this to work. Also there
might be a problem if your date field includes time. The + .99999 part is a
cheat to work around it. Test.
 
Thank you, Its worked like a charm...

--------------------
(Ms-Exl-Learner)
--------------------


Jerry Whittle said:
Between [Forms]![frmParameter2]![From Date] AND [Forms]![frmParameter2]![To
Date] + .99999

The form must remain open, but can be invisible for this to work. Also there
might be a problem if your date field includes time. The + .99999 part is a
cheat to work around it. Test.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Ms-Exl-Learner said:
I have created a Select query for retrieving some particular Date Records
from a table using the BETWEEN expression in query criteria bymentioning the
From Date and To Date and it’s working fine.

Each time I don’t want to open the query and enter the From Date and To
Date, so I want to create TWO Unbound text box in Forms for entering the From
Date and To Date and nearby the text box I am having a command button to run
the query.

Now I want to know how I can connect the Two Unbound Text Boxes that is From
Date and TO_DATE which is created in Forms in the Select Query (BETWEEN). I
want the select query to pick the From date and To Date from the form text
boxes and run the query.

Hope someone will give your valuable suggestion.
 
Thank you, Its worked like a charm.

--------------------
(Ms-Exl-Learner)
--------------------


Douglas J. Steele said:
Use Forms![NameOfForm]![From_Date] and Forms![NameOfForm]![To_Date] as the
parameters in your query.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

Ms-Exl-Learner said:
I have created a Select query for retrieving some particular Date Records
from a table using the BETWEEN expression in query criteria bymentioning
the
From Date and To Date and it's working fine.

Each time I don't want to open the query and enter the From Date and To
Date, so I want to create TWO Unbound text box in Forms for entering the
From
Date and To Date and nearby the text box I am having a command button to
run
the query.

Now I want to know how I can connect the Two Unbound Text Boxes that is
From
Date and TO_DATE which is created in Forms in the Select Query (BETWEEN).
I
want the select query to pick the From date and To Date from the form text
boxes and run the query.

Hope someone will give your valuable suggestion.


.
 
Back
Top