Can I color a field when formating a report this way

G

Guest

I am attempting to format a field background color when formatting for print
and would like to do the following but the background still stays white. Can
I make it a different color?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Left(Me.[ID], 1) = "A" Then
Me.[txtRegionNAME].BackColor = 14869218
End If
End Sub


Thanks,

Jack
 
A

Allen Browne

Presumably ID is a Text field, and you are expecting a light grey when it
starts with an A. Perhaps you could try a darker color until you have this
working.

If you are using Access 2000 or later, it would be much more efficient to do
this with conditional formatting:

1. Select the txtRegionNAME text box.

2. Choose Conditional Formatting on the Format menu.

3. Set the first condition to:
Expression... [ID] Like "A*"
and choose the color you want in the bucket icon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top