If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Want to open a form on the first work day of the month
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! -- David McLean |
#2
|
|||
|
|||
Want to open a form on the first work day of the month
"David McLean" wrote in message
... 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 he 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? -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|