PC Review


Reply
Thread Tools Rate Thread

Conditionally run code/macro

 
 
Timothy
Guest
Posts: n/a
 
      2nd Sep 2003
I am in need of a code that essentially says:
IF I DONT open THISFORM (or click THISBUTTON doesnt
matter what it is) once a month, or week, Then RUN a MACRO.

I have a database that I Manage and I need to check for
duplicates, delete dups, run queries, and print reports.
These are the bare minimums to keep it running smooth and
get required paper work in on time. There are other tasks
I need to do, but they are not suspense date sensitive. I
am just the database ADMIN along with my real duties, so
there are times that I cant get to the database to do
these things.
Id like to automate it so even if I cant make it in the
essentials will get done, usually the end of the month
reports.

All Help is greatly appreciated.
Timothy
 
Reply With Quote
 
 
 
 
Adam
Guest
Posts: n/a
 
      2nd Sep 2003
One possibility that occurs to me is that you could create a table to store
dates of when you do open the forms or click the buttons. You could add a
couple of lines of code to the form's load event or the button's click event
to add a new date to the table.

Once you have done that, you could add some code to the load event of your
startup form to check the latest date in the table (it would be easy to
define a query to do this). It could then fire whatever code you need if it
find that there are no entries within the last month, week, or whatever.

This isn't a spectacularly elegant solution, and I wouldn't surprised if
someone comes up with a neater way of doing it, but I think it ought to
work. Assuming, of course, that you open the database at least once a
month/week etc.

HTH

Adam

"Timothy" <(E-Mail Removed)> wrote in message
news:066701c37119$fd66f510$(E-Mail Removed)...
> I am in need of a code that essentially says:
> IF I DONT open THISFORM (or click THISBUTTON doesnt
> matter what it is) once a month, or week, Then RUN a MACRO.
>
> I have a database that I Manage and I need to check for
> duplicates, delete dups, run queries, and print reports.
> These are the bare minimums to keep it running smooth and
> get required paper work in on time. There are other tasks
> I need to do, but they are not suspense date sensitive. I
> am just the database ADMIN along with my real duties, so
> there are times that I cant get to the database to do
> these things.
> Id like to automate it so even if I cant make it in the
> essentials will get done, usually the end of the month
> reports.
>
> All Help is greatly appreciated.
> Timothy



 
Reply With Quote
 
HSalim
Guest
Posts: n/a
 
      2nd Sep 2003
That is a pretty decent suggestion considering taht access does not have any
built-in jobs scheduler like its big brother SQL server.
Tim,
In addition to that, you could start your database using the windows task
scheduler and schedule it to start every day/week/month.
You should also include code to shut it down after certain tasks are done or
a certain time passes.

HS

"Adam" <(E-Mail Removed)> wrote in message
news:klY4b.1081$(E-Mail Removed)...
> One possibility that occurs to me is that you could create a table to

store
> dates of when you do open the forms or click the buttons. You could add a
> couple of lines of code to the form's load event or the button's click

event
> to add a new date to the table.
>
> Once you have done that, you could add some code to the load event of your
> startup form to check the latest date in the table (it would be easy to
> define a query to do this). It could then fire whatever code you need if

it
> find that there are no entries within the last month, week, or whatever.
>
> This isn't a spectacularly elegant solution, and I wouldn't surprised if
> someone comes up with a neater way of doing it, but I think it ought to
> work. Assuming, of course, that you open the database at least once a
> month/week etc.
>
> HTH
>
> Adam
>
> "Timothy" <(E-Mail Removed)> wrote in message
> news:066701c37119$fd66f510$(E-Mail Removed)...
> > I am in need of a code that essentially says:
> > IF I DONT open THISFORM (or click THISBUTTON doesnt
> > matter what it is) once a month, or week, Then RUN a MACRO.
> >
> > I have a database that I Manage and I need to check for
> > duplicates, delete dups, run queries, and print reports.
> > These are the bare minimums to keep it running smooth and
> > get required paper work in on time. There are other tasks
> > I need to do, but they are not suspense date sensitive. I
> > am just the database ADMIN along with my real duties, so
> > there are times that I cant get to the database to do
> > these things.
> > Id like to automate it so even if I cant make it in the
> > essentials will get done, usually the end of the month
> > reports.
> >
> > All Help is greatly appreciated.
> > Timothy

>
>



 
Reply With Quote
 
Timothy
Guest
Posts: n/a
 
      3rd Sep 2003
That sounds like what I need. You would happend to have an
example of that code to do all this do you? Im new to the
code aspect, but pretty good on the basics.
Thanks again

TImothy
>-----Original Message-----
>One possibility that occurs to me is that you could

create a table to store
>dates of when you do open the forms or click the buttons.

You could add a
>couple of lines of code to the form's load event or the

button's click event
>to add a new date to the table.
>
>Once you have done that, you could add some code to the

load event of your
>startup form to check the latest date in the table (it

would be easy to
>define a query to do this). It could then fire whatever

code you need if it
>find that there are no entries within the last month,

week, or whatever.
>
>This isn't a spectacularly elegant solution, and I

wouldn't surprised if
>someone comes up with a neater way of doing it, but I

think it ought to
>work. Assuming, of course, that you open the database at

least once a
>month/week etc.


>
>

 
Reply With Quote
 
timothy
Guest
Posts: n/a
 
      6th Sep 2003
Thank you much adam. That does help. I have a grasp on
the on open and stuff, Im just learning about the coding.
I think thats still above me for right now. But im
learning..Thanks again

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Conditionally Formatting Comments =?Utf-8?B?RGFyZW4=?= Microsoft Excel Worksheet Functions 2 28th Jun 2007 02:02 AM
Conditionally format in code and count at same time =?Utf-8?B?Q2hyaXN0aW5l?= Microsoft Excel Programming 7 17th Nov 2006 03:42 PM
Conditionally Formatting/Code Only One Word in a Formula =?Utf-8?B?a2RsaWxseQ==?= Microsoft Excel Worksheet Functions 1 10th Aug 2006 04:35 PM
How can I conditionally compile C++ code based on an environment v =?Utf-8?B?QXJ0aHVy?= Microsoft VC .NET 6 5th Nov 2005 03:07 AM
Input Mask dash for zip code - can it conditionally appear? =?Utf-8?B?Tmljb2xsZSBLLg==?= Microsoft Access 0 20th Jul 2005 05:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 PM.