Conditional Formating

gMAC

Registered User.
Local time
Today, 01:16
Joined
Dec 21, 2001
Messages
29
Access 2000: I'm building a report for room booking database, the report will show check in and check out dates based on a between dates parameter query. So the report will show the room number, checking in date and checking out date.
Exp:
Mr. Jones - Room A-17 - Check In 12/2/02 - Check Out 12/15/02
Mr. Smith - Room A-17 - Check In 12/15/02 - Check Out 12/22/02

This report will be given to housekeeping for room cleaning. The problem is I need a way to flag back to back bookings ( a check out and a check in on the same day) so housekeeping will clean those first. I thought I could make the dates red or bold where the check out and check in were equal.

Problem is the check in date and check out date are different records so I can't get conditional formating to work, or a statement like:

(Me!DateIn.ForeColor = IIf(Me!DateIn = Me!DateOut, 123456, 1)

Any ideas how to make just the check in and check out dates that are equal change color?
Thanks
~gMAC~
 
Maybe something like this would work.


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If me.DateIn = me.DateOut Then
me.DateIn.ForeColor = vbRed

Else

me.DateIn.ForeColor = vbBlack

End If

End Sub

Or you could highlight the whole field by using BackColor rather than ForeColor - I think this is better for making an impact.
HTH :)
 
This will only work with the current record. If you look at my first post, Mr. Jones checking out of A-17 is a seprate record from Mr. Smith Checking in to A-17. Me.DateIn = Me.DateOut will only compare the to fields in the same record. But thanks for trying.

~gMAC~
 

Users who are viewing this thread

Back
Top Bottom