Conditional formatting-is it available in code? (A2000)

L

L Mehl

Thanks to Andy Cole for reminding me that Conditional Formatting is in
A2000.

I want to be able to programatically change the back color of the field
having focus in a form, to guide the user's eye to that field.

Conditional Formatting is a quick way to do it, but I want my client to be
able to select the color.

Is Conditional Formatting available via code, so that color can easily be
changed ?

I "Saved as Text" the original form and the form containing CF. The only
difference I could find was a block of text for each field to which I
applied CF, as follows:

Begin Section
....
Begin TextBox
...
Name =" 'control name' "
...
ConditionalFormat = Begin
0x01000000640000000100000002000000ffffffff000000000100000001000000 ,
0x00000000ffcc9900000000000000000000000000000000000000000000000000 ,
0x0000000000000000000000000000000000000000000000000000000000000000 ,
0x00000000
End

I will appreciate any input.

Thanks in advance.

Larry Mehl
 
A

Andy Cole

Larry

Look up the FormatConditions property and collection in Access Help

Example
With Forms("MyForm").Controls("tbCfText").FormatConditions _
.Add(acFielsValue, acGreaterTyhan, "=[tb2]")
.BackColor = RGB(224,224,224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32,160) ' blue with a hint of purple
End With

HTH

Andy
 
L

L Mehl

Thanks Andy.

Newbie question:
Is this code dynamic in the sense that it "lives" when the form opens and
then causes the background color of the field with focus to change?

Larry


Andy Cole said:
Larry

Look up the FormatConditions property and collection in Access Help

Example
With Forms("MyForm").Controls("tbCfText").FormatConditions _
.Add(acFielsValue, acGreaterTyhan, "=[tb2]")
.BackColor = RGB(224,224,224) ' pale Gray
.FontBold = True
.ForeColor = RGB(64, 32,160) ' blue with a hint of purple
End With

HTH

Andy


L Mehl said:
Thanks to Andy Cole for reminding me that Conditional Formatting is in
A2000.

I want to be able to programatically change the back color of the field
having focus in a form, to guide the user's eye to that field.

Conditional Formatting is a quick way to do it, but I want my client to be
able to select the color.

Is Conditional Formatting available via code, so that color can easily be
changed ?

I "Saved as Text" the original form and the form containing CF. The only
difference I could find was a block of text for each field to which I
applied CF, as follows:

Begin Section
...
Begin TextBox
...
Name =" 'control name' "
...
ConditionalFormat = Begin
0x01000000640000000100000002000000ffffffff000000000100000001000000
0x00000000ffcc9900000000000000000000000000000000000000000000000000
0x0000000000000000000000000000000000000000000000000000000000000000
,
0x00000000
End

I will appreciate any input.

Thanks in advance.

Larry Mehl
 

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