Query Criteria not before date

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Using A2007 I'm designing an archive query that can only be run after the end
of the year. I've got the query to return the appropriate year (current) but
i don't want it to used until the new year.

Any thoughts as to how I would prevent the query from being accidently run?
 
If you give your users access to the Database / Navigation pane, then no. If
you do not let your users have direct access to the queries, and instead
control the running of queries by a macro or form, then yes.

What is your setup?
 
Don,

Thinking out loud here...

What if you made the query run using the previous year, since your not going
to run it until next year anyway. That way even IF it is accidently run,
who cares it's running using the current year.

Also, you don't state where you putting the query that it could be
accidently run. Is it on the Main Menu?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
I should have mentioned this archive query is in fact a Make Table query so
it's going to overwrite any existing archived data anyway! i'll just put some
warning messages on the Archive Data forms' run query button.
thanks for your thoughts anyway....
 
I should have mentioned this archive query is in fact a Make Table query so
it's going to overwrite any existing archived data anyway! i'll just put some
warning messages on the Archive Data forms' run query button.
thanks for your thoughts anyway....

Just put code in the run query button code to check today's date before
running the query. However, every day in the year is in "a new year" - you
might not get around to running the query until November, right?
 
On Thu, 28 May 2009 05:05:01 -0700, Don

You could hide the query. Unfortunately queries are too simple to
allow "Are you sure you want to run this?" - kind of dialogs.
I guess you could force an error by having the query call a VBA
function that returns an illegal value or even issue a Stop
instruction, but that would be rather crude.
You can also grab the sqlstatement of this query and put it in a code
module, delete the query, and and execute it only from code.

-Tom.
Microsoft Access MVP
 

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

Similar Threads

Query criteria 4
Problem with date criteria in Query 2
Date search query 0
Date criteria 9
date criteria 7
Query Date criteria 5
Query to Complex with Criteria 1
How to show qry "criteria" on a report ? 10

Back
Top