Want to open a form on the first work day of the month

D

David McLean

Hi there.

I've got a problem and unfortunately I don't have any clue where to START a
solution. I've got a form (frmAutoNotify) that I would like to open
automatically when the database is opened on the first work day of every
month. The form basically has a couple of queries on it that show the user
where gaps in the data for the last month are so they can make sure that all
data entry is complete.

I'm thinking I'm probably going to need a table that lists all of the
non-work days each year (including weekends? not sure if access can figure
this out automatically), but other than that I've no clue what i need to do.

If anyone could give me some advice, I would greatly appreciate it!
Thanks!
 
D

Dirk Goldgar

David McLean said:
Hi there.

I've got a problem and unfortunately I don't have any clue where to START
a solution. I've got a form (frmAutoNotify) that I would like to open
automatically when the database is opened on the first work day of every
month. The form basically has a couple of queries on it that show the user
where gaps in the data for the last month are so they can make sure that
all data entry is complete.

I'm thinking I'm probably going to need a table that lists all of the
non-work days each year (including weekends? not sure if access can figure
this out automatically), but other than that I've no clue what i need to
do.


The workday math functions posted here:

http://www.mvps.org/access/datetime/date0012.htm
Date/Time: Doing WorkDay Math in VBA

.... include a function to determine what is the first workday of any given
month. With that code in your database, you can tell whether today is the
first workday in the month using a test like this:

If Date() = dhFirstWorkdayInMonthA() Then
' Today is the first workday in the month.
End If

If you want to take holidays into account, you do have to include a table or
array of holdays.

Now, even with that problem out of the way, you still need to address a
couple of questions:

1. Can you ensure that the database will in fact be opened every workday?

2. If the database wasn't opened on the first workday of the month, what do
you want to do? Do you want to open your form the first time the database
is opened during a month, even if that is not the first workday?

3. If the database is opened more than once on the target day, do you want
to open the form each time? Or only the first time the database is opened
that day? Or would you want the user to make a decision about that -- a
"Don't show this again until next month" option?
 

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

Top