Conditional Format on a report/Select Case (97)

StephenB

Registered User.
Local time
Yesterday, 21:04
Joined
Apr 18, 2002
Messages
101
I use the following on a form to conditionally format a field.

If Me.Submitter = "Black, Stephen" Then
Me.Date_Submitted.BackColor = 255
Else: Me.Date_Submitted.BackColor = 8421376
End If

I'd like to do something similar on a report. I've tried different combinations and approaches similar to the following:

If [CPT]= "99251" then
CPT.BorderStyle = Solid
Else CPT.BorderStyle = Transparent
End If

I've even tried "CPT.BorderStyle.Solid = True" and so on, but nothing so far. It doesn't have to be border style. Any type of formatting that will draw attention to a specific value on a black and white printed report will do. Any suggestions?

Also, can someone provide info on "Select Case"? I have a feeling I'm going to need to use it since it's not just 99251 but 99252 and 99253 as well that I need to trigger the reformat and I have zero experience with select case.
 
You've used Me. on the form but not on the report, any reason why not?
 
No reason, Rich. I had tried numerous combinations, many of which included Me., the above was the last.

The following works, but I need something that will make the data stand out more.

If CPT = "99251" Then
[CPT].FontUnderline = True
Else: [CPT].FontUnderline = False
End If

I'd like to do something with Back Style since a border would be more eye catching, so I tried the following but I'm not getting the syntax right:

If CPT = "99251" Then
CPT.BorderStyle.Solid = True
Else: CPT.BorderStyle.Solid = False
End If

Apparently, I'm doing OK with properties with yes/no options, but I'm not getting the syntax correct for properties that have a list of options (BorderStyle: Solid, transparent, dashes... or FontWeight: Light, Normal, Heavy).

Any suggestions?
 
Try This

Try this, Stephen.....

If Me![CPT] = "99215" Then
Me![CPT].BorderStyle = 1 'Solid Border
Else
Me![CPT].BorderStyle = 0 'No Border
End If

Hope this helps, as it works for me in Access 97. Alas, I can't help with the "CASE" commands.

I would like to see something on this, though...as I'm working a project where I could certainly use several case selects with conditional formatting (Access 97).

Bob in Indy
 
Last edited:

Users who are viewing this thread

Back
Top Bottom