Conditional Formatting -- Lock and Custom Color (1 Viewer)

Matty

...the Myth Buster
Local time
Today, 00:17
Joined
Jun 29, 2001
Messages
396
Hi,

I have a continuous subform with a checkbox and a textbox. If the checkbox is checked, I would like the textbox to enable. Since using code will enable the textbox for ALL the records, I'm assuming I need to use conditional formatting.

The problem is that I'd like to set the Locked property of the textbox as well. Just disabling the textbox makes the text hard to read -- it's currently white forecolor, blue backcolor and disabling would make the forecolor grey. The conditional formatting dialog looks like it doesn't use the Locked property, so is there another way I can do it?

Along the same lines, I'd like to use a custom color for my formatting (my blue isn't a standard blue color). Is there a way to enter the numerical value for the color, rather than just pick one from the palette?
 
Last edited:

RuralGuy

AWF VIP
Local time
Yesterday, 23:17
Joined
Jul 2, 2005
Messages
13,826
Since using code will enable the textbox for ALL the records, I'm assuming I need to use conditional formatting.
Not if the checkbox is bound to a field in the underlying query/table.
 

Matty

...the Myth Buster
Local time
Today, 00:17
Joined
Jun 29, 2001
Messages
396
Maybe I'm doing something wrong then. My underlying query has a field called VariablePrice, and that's bound to my checkbox named chkVariablePrice. Here's the code I have:

Code:
    If Nz(Me!chkVariablePrice, 0) <> 0 Then
        Me!txtPartPrice.Enabled = True
        Me!txtPartPrice.Locked = False
    Else
        Me!txtPartPrice.Enabled = False
        Me!txtPartPrice.Locked = True
    End If

If the box is checked for one of the records, txtPartPrice is enabled and unlocked for all the records in the subform.
 

RuralGuy

AWF VIP
Local time
Yesterday, 23:17
Joined
Jul 2, 2005
Messages
13,826
Hi Matty,

I hate it when this happens but I have no idea what I had in mind when I responded the first time. I'm really sorry. AAADD - Age Activated Attention Deficit Disorder. :eek:

Stephan Lebans has some code that might be just what you need.
http://www.lebans.com/formatbycriteria.htm

I haven't used it yet but Stephan has been known to perform magic. :)
 

Matty

...the Myth Buster
Local time
Today, 00:17
Joined
Jun 29, 2001
Messages
396
I'm looking at that code, and I'm not sure if that will help out my situation. Does anyone else have any suggestions?
 

Users who are viewing this thread

Top Bottom