Connecting Text Box in Query Criteria

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.
 
D

Douglas J. Steele

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

Jerry Whittle

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.
 
M

Ms-Exl-Learner

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.
 
M

Ms-Exl-Learner

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.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top