Query Date Changes

Neo-fite

Registered User.
Local time
Today, 17:15
Joined
May 17, 2011
Messages
60
Not sure if the is the right area, but here's my situation.

I have a huge table that I import into my 2007 Access db. Then within access, I have multiple queries that I utilize on a weekly, monthly, quarterly basis.

Would it be possible to somehow change/indicate the start/end dates that are used within the queries in l location rather than having to alter each of the queries in each weekly, monthly, quarterly instance?
 
Sure; options include putting them into form textboxes and pointing the query criteria there, and having a one-record table with the dates in it and including that table in your queries.
 
You could just have a form with two text boxes for the start and end dates and then just put in the dates you want and have the criteria on the query be:

Between [Forms]![FormNameHere]![StartDateTextBoxNameHere] And [Forms]![FormNameHere]![EndDateTextBoxNameHere]
 
Thanks for the info. Being relatively new to Access, I'll need to research how to implement this and move forward.
 
OK, so I created a form called Date_Entry which has a textbox call Start_Date (formatted as short date0

I put this in the criteria and it doesn't recognize it when I "run" the query.
Code:
<[Forms]![Date_Entry]![Start_Date]
 
So two questions -

1. Are the names of the form and control really what you have there including the underscore?

2. What are you typing into the text box for a date? (and are you able to move to another control so that Access updates the text box because when it isn't bound it doesn't always recognize a value in it unless you can move to another control or hit the enter key while in the field.
 
I figured it out!

I had closed the Form. I thought that the date(s) entered would be retained. It works fine when I leave the for open. :D
 
3. Is the form open at the time the query is run? It needs to be.
 
Oops, slow typing again. Glad you found the problem.
 

Users who are viewing this thread

Back
Top Bottom