Alain,
Your requirement requires some code. I'll assume you have some programming experience / support. If not, just yell for more help.
(a) Create a new module; call it modGraphUtils
(b) Paste in the following two functions:
Function TimeLine(CurrentTimeLine As String, _
StartTime As Date, _
Intervals As Integer) As String
'-------------------------------------------------------------------------
'Given an existing timeline, plus a start time, and a number of intervals
'graphically mark off time intervals along the timeline
'-------------------------------------------------------------------------
'-------------------------------
'Set up the baseline time as 9am
'-------------------------------
Dim Basetime As Date: Basetime = #9:00:00 AM#
Dim StartPos As Integer
Dim ThisPosition As Integer
Dim IntervalsIncluded As Integer
Dim Headings As String
'-----------------------------------------------------------------
'Determine the starting position to mark up in the timeline string
'Note that every 15 minutes designates one character position.
'-----------------------------------------------------------------
StartPos = DateDiff("n", Basetime, StartTime) / 15 + 1 + _
DateDiff("h", Basetime, StartTime)
'--------------------------------------------------------------------
'Now mark up from the starting position, for the number of intervals,
'but jump over the space position, every 5 characters.
'--------------------------------------------------------------------
IntervalsIncluded = 0
ThisPosition = StartPos
Do
If IntervalsIncluded = Intervals Then
Exit Do
End If
If ThisPosition Mod 5 <> 0 Then
Mid(CurrentTimeLine, ThisPosition, 1) = "*"
IntervalsIncluded = IntervalsIncluded + 1
End If
ThisPosition = ThisPosition + 1
Loop
TimeLine = CurrentTimeLine
End Function
Function TimeLineTest()
'--------------------------
'Test the TimeLine function
'--------------------------
Dim TimeHeading As String
Dim StartTime As Date
Dim Intervals As Integer
Dim CurrentTimeLine As String
'-----------------------------
'Initialise timeline to blanks
'-----------------------------
CurrentTimeLine = Space(120) 'ie. 24 hours * 5 positions per hour
'---------------
'Display Heading
'---------------
TimeHeading = "0900 1000 1100 1200 0100 0200 0300 0400 0500 0600 0700 0800 0900"
Debug.Print TimeHeading
'------------
'First lesson
'------------
StartTime = #10:30:00 AM#
Intervals = 5
CurrentTimeLine = TimeLine(CurrentTimeLine, StartTime, Intervals)
'-------------
'Second lesson
'-------------
StartTime = #2:00:00 PM#
Intervals = 3
CurrentTimeLine = TimeLine(CurrentTimeLine, StartTime, Intervals)
'----------------
'Display Timeline
'----------------
Debug.Print CurrentTimeLine
End Function
(c) Test the first function called timeline(), using the TimelineTest() function.
(d) You should then be able to adapt this to your requirement and/or call it for your reporting purposes.
Cheers,
Steve