Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying keyed in date criteria from one field to another

Status
Not open for further replies.

Blake290

MIS
Apr 3, 2003
17
US
I have a report written based on a query of three joined querys. One query forces the report to prompt users to enter a beginning date range and then an ending date range. I used the "between" function in this criteria with the date range.

I would like to take the "between" value of the date beginning and ending date range from the one query and apply this to another query critera. Right now the querys are joined by the "part num".

Could I simply add another join to the date fields? Would this be an outer join? Can Access do this? Or is there a way to take the inserted keys in value from one query and insert it into another query's field criteria?

 
Instead of having the prompts in the queries themselves, which would cause the user to enter the dates 3 times, create a new unbound form that the user would enter the dates in 2 unbound fields StartDate and EndDate. Then, set the criteria of the fields in place of the prompts to refer to these form fields:

[tt]between [forms]![NEW FORM NAME]![StartDate] and [forms]![NEW FORM NAME]![EndDate][/tt]

Set a button on this form that will run the queries, and in the button's ON CLICK event, use SQL to run the 3 queries. Hope this helps.

Jim DeGeorge [wavey]
 
Jim,

I am appreciative in your guidance and in taking the time to help me. I did not know much about forms, but enjoyed the challenge in figuring it out. Thank you, Thank you, Thank you.

God bless you too!

Blake
 
Blake

Sounds like you got it to work! Glad to have helped.

And, thanks for the blessings...they're worth a ton more than the stars you give to users who help you with questions! ;-)

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top