|
 |
access thread: Access Startup Question
Message #1 by "Mark Irvine" <mark@m...> on Sun, 12 Aug 2001 19:12:47
|
|
Hi,
I recently purchased Beginning Access 2000 VBA and found it extremely
useful. My recent task at work was to build an automated reorder module,
much the same as Chapter 15. However this module must be run
automatically at the start of every month. I have two questions:
1 What is best way to get this module to run at start-up. Is there an
onStartup att in much the same way there is an onLoad att in the body tag
of an html document?
2 To ensure this procedure is only run once, by the first person to run
the database at the start of the month. I have made use of a table, which
will only have one entry - the date the procedure was last run. I then
compare the current month to the month stored in this table and if it
is 'greater' the procedure is run. However if it is the same it is not
run - does this sound like a good approach?
Mark
Message #2 by "Richard Lobel" <richard@a...> on Sun, 12 Aug 2001 15:50:23 -0700
|
|
Name the sub routine AutoExec and it will automatically run at start-up.
Access has a couple of built in names that result in automatic
funtionality. Your approach in Number 2 sounds fine.
Richard Lobel
Accessible Data
richard@a... <mailto:richard@a...>
Cell: (xxx) xxx-xxxx
Fax: (xxx) xxx-xxxx
Message #3 by "Peter Kaufman" <kaufman@l...> on Mon, 13 Aug 2001 09:52:15 +0700
|
|
> -----Original Message-----
> From: Mark Irvine [mailto:mark@m...]
> Sent: August 12, 2001 7:13 PM
> To: Access
> Subject: [access] Access Startup Question
>
>
> Hi,
>
> I recently purchased Beginning Access 2000 VBA and found it extremely
> useful. My recent task at work was to build an automated reorder module,
> much the same as Chapter 15. However this module must be run
> automatically at the start of every month. I have two questions:
>
> 1 What is best way to get this module to run at start-up. Is there an
> onStartup att in much the same way there is an onLoad att in the body tag
> of an html document?
Hi Mark,
Create a form that opens on startup (Tools -> Startup). Use the form's open
event to fire your code.
> 2 To ensure this procedure is only run once, by the first person to run
> the database at the start of the month. I have made use of a
> table, which
> will only have one entry - the date the procedure was last run. I then
> compare the current month to the month stored in this table and if it
> is 'greater' the procedure is run. However if it is the same it is not
> run - does this sound like a good approach?
Yes, as long as you are comparing years as well!
> Mark
>
Message #4 by "Mark Irvine" <mark@m...> on Mon, 13 Aug 2001 09:30:35
|
|
All,
Thanks for all your help!
Mark
|
|
 |