RLI: Conditional formating and transparency

R

Rob

Hello all,
I have a form field with transparent background.
If i use conditional formating and conditions are not met it changes the
transparency to normal showing then background color White.
Is it possible to use conditional formating and only change the background
transparency and background color when conditions are met?
 
S

strive4peace

Hi Rob,

not that I know of ... try setting the value of the BackColor property
to the same as the value in the form section (or is that what you are
changing? -- if it is, try changing border or text color instead)

Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
R

Rob

Thank you Crystal for your reply.
The problem is my form is a continuous form with alternating row colors
using the method Stephen Lebans proposed ...coloring the detail section.
What i wanted to do is highlight the current row.
So i placed a transparent field behind the normal fields and try to color it
red using conditional formating. But you see what is happening: the initial
property 'transparent' is overruled by the 'default' background setting of
the conditional format condition. And those 'default settings' cannot be set
to 'transparent'. The result is that all non-current rows are now shown with
the 'default' color white losing the alternating row colors.

Any ideas?
 
S

strive4peace

Hi Rob,

Stephen's code is a masterpiece ... and the backcolor does need to be
transparent for the alternating rows to show.

for those of you not familiar with this example, it can be found here:

http://lebans.com/alternatecolordetailsection.htm

~~~

instead of highlighting the row, how about using a textbox as an
underline? You can set the "normal" color to a light gray and the
current row color to bright yellow or something obvious ...



Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
R

Rob

Thanks again,
You mean to say...a textbox with very small hight, imitating a kind of line
under the current row...?
Nice idea, I will give it a try.....

Thanks
 
S

strive4peace

Hi Rob,

you're welcome ;)

"you mean to say...a textbox with very small hight, imitating a kind of
line under the current row...? "

yes, thank you for clarifying that <smile>

make sure for the "highlight box" to set:

TabStop = No
Locked = Yes
Enabled = No

when I use a highlight box behind controls, I also use the Click event
to SetFocus to another control ... even though it is not enabled, it
will come to the front when you click on it (that may be version
dependent)... for a line, it probably wouldn't matter

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
V

Vincent.Verheul

With some Visual Basic coding in your Form you can programmatically set the
conditional formatting for your TextBox control (called TextBoxID in the
example below). Use the Load event of your Form. In the example the
fore-color is red when the value is negative and the back-color is
transparent:

Private Sub Form_Load()
Dim i As Integer
With TextBoxID.FormatConditions ' Set conditional formatting
TextBoxID
' Remove any existing conditional formatting
For i = 0 To .Count - 1
.Item(0).Delete
Next i
' Add one condition for this TextBox control
.Add acExpression, acEqual, "[TextBoxID]<0"
.Item(0).ForeColor = 155 ' Red
.Item(0).BackColor = -2147483633 ' Transparent
End With
End Sub
 

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