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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatically update a field

Status
Not open for further replies.

smoker1

Programmer
Jun 18, 2001
76
US
How can I make an update query that updates on the first of each month? (I know how to do it every so many days, but that doesn't work for my need.)

Thanks in advance for your help!!

--Angela
 
Well, if you think about it, you need to do three things here.

1) Check to see if it's first of the month.
2) If it is, check to see if the update has been run yet.
3) If it hasn't, run it.

You'll probably need to make a tiny table with a field in it to store some flag that you can check , to see if you've already run this guy once today (today being the first of the month, right?...)

You can do that pretty much any of about 10 different ways, or just ignore it and run the update every time you open the database on the first of the month. That's up to you.

But here's how to check to see if TODAY is the FIRST of the month:
Code:
IF DATE() = 
   DateSerial(Year(date), Month(date),1)
THEN
   "Today is the first day of the month"
ELSE
   "Today is not the first day of the month"

HTH


Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at
 
If you need to add more sophistication to this process, you can use the Task Scheduler. I have several 'housekeeping' routines I run with it.

I create a small VB program to perform the task (update, archive, etc.). I then add the .exe to the Scheduler. It can be run with a wide variety of timing options.

WildHare is correct in stating you need some control(s) for these processes. I use log files. I get notified by e-mail when a process has successfully completed, or when it failed.

This takes a little work setting up, but really works well when you have many process to maintain/monitor.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top