Return user input value in a query

brumshine

Registered User.
Local time
Today, 09:21
Joined
Dec 17, 2008
Messages
37
Does anyone know if it is possible to return the values that are what a user inputs in [Enter Start Date] and [Enter End Date] in the results of the query? I would like to have the start date and end dates to be returned so that I could use them to filter other joined queries.

Thanks in advance for any suggestions or ideas,

BRUMSHINE
 
Does anyone know if it is possible to return the values that are what a user inputs in [Enter Start Date] and [Enter End Date] in the results of the query? I would like to have the start date and end dates to be returned so that I could use them to filter other joined queries.

Thanks in advance for any suggestions or ideas,

BRUMSHINE

Try adding them as parameters in the Select Statement (With an Alias of course)
 
That sufficiently doese exactly what I requested, thanks a lot. One thing that I wish I could acomplish by using this is use the input to filter the query it is gathered in. Is that possible, if so how do I do it?

Thanks a ton, you're awesome.

BRUMSHINE
 
That sufficiently doese exactly what I requested, thanks a lot. One thing that I wish I could acomplish by using this is use the input to filter the query it is gathered in. Is that possible, if so how do I do it?

Thanks a ton, you're awesome.

BRUMSHINE

To filter them, you might try adding [Enter Start Date] or [Enter End Date] in a Where Clause. Access should be able to determine that they are the same as you used in the Select Statement, and only only ask for the value one time. If that does not work, I defer to the other experts.
 
This is most helpful - thanks.

Taking it a step further how could I run a report of a query but instead of typing the start and end dates, use a calendar on a form for thew user to select start and end dates?
 
The criteria should be entered via a form, that way you can

1) validate the criteria
2) being on a form the values can be referred to in a query, a report or any other object so long as the form is open.
3) another reason for doing this, is when you close the report the form with the criteria is still there if you want to change the criteria and produce the report again.
 
Last edited:
If say I enter a date into a text box on the form how would I get that value into the criteria on the query ?
 
If say I enter a date into a text box on the form how would I get that value into the criteria on the query ?


The example condition statement below assumes the following (Substitute as required):
  • There is a Table called YourTable that contains a Column called YourDate
  • There is a Form called YourForm, that contains a Form Control called YourControlDate
Where YourTable.YourDate = [Forms]![YourForm]![YourControlDate]
 
Thanks for such a great answer, that sorted my problem out 100% :D
 
BRABUS,

I found it helpful to return the selected date to a textbox so that the user can review it first before running the query. I set 2 calendar objects to visible equals false, then when the user clicks the text box to type in a start date, BAM a calendar pops up, click a date and it is in the box. I do the same for the end date. When the user presses a button the query launches with the values of the text boxes as criteria. Just a suggestion.

Thanks!

BRUMSHINE
 

Users who are viewing this thread

Back
Top Bottom