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

HAVE NO IDEA HOW TO DO THIS!

Status
Not open for further replies.

Angelique

Technical User
Mar 9, 2001
127
AU
I have recently been asked to assist a colleague with a problem but I don't have the experience to help. Having said that, I thought you guys & gals might have done something like it.

The scenario is that a text file is imported into Access on a weekly basis. The text file appears to be times down the left-hand column with times with say 15 min intervals (just like an diary) and time values in all the other columns.

This is where is gets strange:
If a record's time adds up to say, 20 minutes accummlative then it would be a certain colour in the first column. If time was greater, it would be a another colour and so on.

The report would be printed like a matrix (continuous form style) with Time Interval on the left-hand side, time values in columns (some will obviously have no values) and assign colours to certain levels e.g. Yellow for 20, Green for 20 to 40 etc.

Any ideas?


Yours


Angelique
 
Here is a procedure to format the field(s) of a report using the forcolor property. Obviously this needs to be modified to suit your needs (restrict to ONE field, Choice of colors ... ).

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

    'Just to "Color Code" the report fields

    For Each Ctrl In Me.Controls

        If (Left(Ctrl.Name, 5) = "txtHr") Then

            Select Case Ctrl

                Case Is = "A"
                    Ctrl.ForeColor = RGB(255, 0, 0)

                Case Is = "L"
                    Ctrl.ForeColor = RGB(125, 125, 0)

                Case Is = "P"
                    Ctrl.ForeColor = RGB(0, 125, 125)

                Case Is = "F"
                    Ctrl.ForeColor = RGB(0, 0, 255)

            End Select

        End If

    Next Ctrl

End Sub
MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top