Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2008

Tip: Looking for answers? Try searching our database.

Conditional Formating a Textbox in report...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chemicals - 13 Mar 2008 16:15 GMT
I have a report that I want to change any empty fields (textboxes) to have a
red background.  I cannot seem to get backgound colors to work?

If I set conditional formatting on a value < 10 with text color changing it
seems to work.

Here's my 2 attempts:

Len([NumberOfReps])<1 Or IsNull([NumberOfReps]) ---set background to red

Then I tried this in the OnFormat event of the Detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   If Not Len(Me.NumberofReps) >= 1 Then
       Me.NumberofReps.BackColor = vbRed
   End If
End Sub

Background colors don't seem to change???
chemicals - 13 Mar 2008 16:18 GMT
Never mind!!!

I had the textbox properties for BackStyle as Transparent instead of
Normal......Duh!



> I have a report that I want to change any empty fields (textboxes) to have a
> red background.  I cannot seem to get backgound colors to work?
[quoted text clipped - 15 lines]
>
> Background colors don't seem to change???
Allen Browne - 13 Mar 2008 16:21 GMT
Assuming this is Access 2000 or later, you don't need any code. Just use
Conditional Formatting.

1. In report design view, select the NumberOfReps text box.

2. Choose Conditional Formatting on the Format menu.

3. Set Condition 1 to:
   Expression:            [NumberOfReps] Is Null
and choose the color in the bucket.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a report that I want to change any empty fields (textboxes) to have
>a
[quoted text clipped - 17 lines]
>
> Background colors don't seem to change???
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.