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

Dates

Status
Not open for further replies.

pbrown77

Technical User
Feb 21, 2005
55
US
This is a "nice to have" since we need to count the number of M-F, FSS, etc for a date range.
Is there away for a calander to pop up on a form that will show what day each date for the date range?
I.E.
This weeks date range: 6/6/05 - 6/12/05
somthing to show
6/6/05 = Monday
6/7/05 = Tuesday
6/8/05 = Wednesday

etc.
only in a box format like a calander.

Like I said it would be a nice to have.
 
a calander would be fairly easy but why make them count manually why not just count the days in the date range for them

something like this

Function daycounts(startdate As Date, enddate As Date) As String
Dim daycnt(8), intx As Byte, intday As Byte
Dim sttemp As String
While startdate <= enddate
intday = WeekDay(startdate)
daycnt(intday) = daycnt(intday) + 1
startdate = startdate + 1
Wend
startdate = Date - WeekDay(Date) + 1
For intx = 1 To 7
daycnt(intx) = Format(startdate, "DDD") & " " & daycnt(intx)
sttemp = sttemp & daycnt(intx) & " "
startdate = startdate + 1
Next
daycounts = sttemp

 
Just use the controls value property. That should be enough for what you want.

Sub NameOfCalendar_Click
Me.Label.caption=Me.NameofCalendar.Value
End Sub

You can use Me.Label.caption = Me.NameofCalendar.Value+1 etc to get spans of output.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top