Question : Overlapping labels - Highlight

I am in the process of developing a school timetable report which shows an individuals timetable for a week in the traditional graphical way, i.e. a grid of 1 row for each day of the week, with a box (a label) for each session on that day.

The on format event of the DEATIL section uses the record source to define the start position (left) and width of each box for each session.

It all works great apart from one thing; that is, if an individual has more than one session for a given day where the times overlap, i.e. the first session for the day is say 9-10.30, and the second session for the same individual on the same day is from 10-11; obviously the individual can not be in 2 places at once, thus this situation indicates a clash.  What I would like to do is highlight (say change the colour for each overlapping box) to indicate to the reader of the report that a clash exists and where that clash exists.

Any ideas greatly appreciated.

Answer : Overlapping labels - Highlight

How is the "time" portion of the session stored in your database?

Some logic like this may work if they are stored as datetime or time fields

if me.mycontrol1.endtime > me.mycontrol2.starttime then
me.mycontrol2.backcolor = vbRed
else
do whatever
end if

depends though on how your time is stored.
J
Random Solutions  
 
programming4us programming4us