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

Vacation Calendar???

Status
Not open for further replies.

nat1967

Technical User
Feb 13, 2001
287
US
Hi Group,

I am looking for suggestions.

I have a database my direct reports use to input their vacation schedule for the upcoming year. It works fine. However, I need to be able to restrict the number of people off on a given day.

Question 1: How can I check a given month to see if there are more than 2 people off on a given day?

Question 2: How can I make the days where more than two are off non selectable on my calendar?

I am using the basic calendar control in A2K for my calendar. Is it possible to display the dates that are not available in a different color? Hmmm....

Any suggestions or thoughts are welcome. I am sure this puzzle is solvable. :)

Have A Great Day!!!,

Nathan
Senior Test Lead
 
In answer to Q1, assuming a table called tblVacation which has StartDate and EndDate fields:

Code:
.
.
.
If DCount("*", "tblVacation", Now() & " Between StartDate And EndDate") > 2 Then
    Msgbox "There are already too many people off on this date.", vbExclamation
End If
.
.
.

Obviously this code checks todays date (via the Now() function) but can be easily modified to take any date you wish to pass into this code.

HTH [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top