[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

FormatConditions backcolor help

Posted on 2007-04-01
5
Medium Priority
?
1,109 Views
Last Modified: 2013-11-28
Can anybody give insight on this.. The following vba codition works correctly EXCEPT for the backcolor of the text field.. the result of Any rgb changes the backcolor result is Black. When I shut off the conditionns the backcolor goes back to white but when clicking my condition button the Forecolors work (blue,pink,purple) but the background color stay at black.. I wanted it yellow RGB(255, 255, 0)..

----------------------------------------------------------------------
Dim fcd1 As FormatCondition

If Me.Contact1First.FormatConditions.Count > 0 Then
MsgBox "Conditional format already exists."
Exit Sub
End If

Set fcd1 = Me.Contact1First.FormatConditions.Add(acExpression, acEqual, "Date()>=[trialstartdate] And Date()<=[trialenddate] And [contractstatus]='Unsigned'")
Set fcd1 = Me.Contact1First.FormatConditions.Add(acExpression, acEqual, "date() > [TrialEndDate] And [ContractStatus] = 'Unsigned'")
Set fcd1 = Me.Contact1First.FormatConditions.Add(acExpression, acEqual, "[contractstatus]='signed' Or [contractstatus]='N/A'")

With Me![Contact1First].FormatConditions(2)
    .FontBold = True
    .FontItalic = True
    .FontUnderline = False
    .BackColor = True
End With

Me.Contact1First.FormatConditions(0).ForeColor = RGB(72, 61, 139)
Me.Contact1First.FormatConditions(0).FontBold = True
Me.Contact1First.FormatConditions(0).BackColor = RGB(255, 255, 0)
Me.Contact1First.FormatConditions(0).BackColor = True


Me.Contact1First.FormatConditions(1).ForeColor = RGB(255, 62, 150)
Me.Contact1First.FormatConditions(1).FontBold = True
Me.Contact1First.FormatConditions(1).BackColor = RGB(255, 255, 0)
Me.Contact1First.FormatConditions(1).BackColor = True


Me.Contact1First.FormatConditions(2).ForeColor = RGB(255, 0, 255)
Me.Contact1First.FormatConditions(2).FontBold = True
Me.Contact1First.FormatConditions(2).BackColor = RGB(255, 255, 0)
Me.Contact1First.FormatConditions(2).BackColor = True
0
Comment
Question by:joein610
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
TheSloath earned 2000 total points
ID: 18834201
You're setting the backcolor twice?

Me.Contact1First.FormatConditions(1).BackColor = RGB(255, 255, 0)
Me.Contact1First.FormatConditions(1).BackColor = True


...and ultimately to -1
0
 
LVL 75
ID: 18834206
What happens if you remove the lines:

Me.Contact1First.FormatConditions(0).BackColor = True

?

mx
0
 

Author Comment

by:joein610
ID: 18834215
Ahh THANX@!!!

For the first time I spent the time to incease my conditions and I got fouled up..

0
 

Author Comment

by:joein610
ID: 18834287
I guess access even through code has a 3 condition limit??
0
 
LVL 9

Expert Comment

by:TheSloath
ID: 18834993
Yeah - annoying isn't it :-)
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question