Sort of Conditional Formating

B

Bill

Hi All,

Can anyone tell me how to change the font of text in a text box depending on
the value of a yes/no field on the same form please?

Ta.
Bill
 
B

BruceM

Click the control to select it, then click View > Conditional Formatting.
Select "Expression Is" in the leftmost box, then in the box to the right of
that put something like:
[YourField] = -1
Select the font choices you wish to use if the field is True (checked).

YourField is the name of the YesNo field. If you wish to format if the
field is False (unchecked), use 0 instead of -1.
 
F

fredg

Hi All,

Can anyone tell me how to change the font of text in a text box depending on
the value of a yes/no field on the same form please?

Ta.
Bill

If you want to change the font to Bold or Undertline, etc., or it's
forecolor, use the control's conditional formatting property.

If you wish to actually change the font to a different font name,
you'll need to use code in the check box AfterUpdate event:

If Me![CheckName] = True Then
Me![OtherControlName].FontName = "Times New Roman"
Else
Me![OtherControlName].FontName = "Arial"
End If
 
B

BruceM

I read the question rather quickly, and did not pick up on the possibility
that the OP wanted to change the font type. However, it could be misleading
to refer to a Conditional Formatting property, which does not appear that I
can see on a control's property sheet.

fredg said:
Hi All,

Can anyone tell me how to change the font of text in a text box depending
on
the value of a yes/no field on the same form please?

Ta.
Bill

If you want to change the font to Bold or Undertline, etc., or it's
forecolor, use the control's conditional formatting property.

If you wish to actually change the font to a different font name,
you'll need to use code in the check box AfterUpdate event:

If Me![CheckName] = True Then
Me![OtherControlName].FontName = "Times New Roman"
Else
Me![OtherControlName].FontName = "Arial"
End If
 
F

fredg

I read the question rather quickly, and did not pick up on the possibility
that the OP wanted to change the font type. However, it could be misleading
to refer to a Conditional Formatting property, which does not appear that I
can see on a control's property sheet.

fredg said:
Hi All,

Can anyone tell me how to change the font of text in a text box depending
on
the value of a yes/no field on the same form please?

Ta.
Bill

If you want to change the font to Bold or Undertline, etc., or it's
forecolor, use the control's conditional formatting property.

If you wish to actually change the font to a different font name,
you'll need to use code in the check box AfterUpdate event:

If Me![CheckName] = True Then
Me![OtherControlName].FontName = "Times New Roman"
Else
Me![OtherControlName].FontName = "Arial"
End If

Hi Bruce,
Access objects have lots of properties that don't appear on the
property sheet.

Select a control on a form and give it a conditional format.
Save the change. Close the form.

Click on Tools + Analyze + Documenter
Select the form you have that conditional formatted control on and
place a check in it's check box.
Click on the Option button. Make sure the Names and Properties box is
checked (to un-complicate the report, you might want to uncheck
everything else on that Options dialog, otherwise you'll wade through
lots of data). While still in this dialog box, click on Properties.
Select the Format properties and the Other Properties.
Click OK 3 times and you'll see the report.
Find the name of the control you placed the conditional formatting on
and you'll find it's conditional format property listed on the page.

The property does not appear if the control does not have conditional
formatting.
 
B

Bill

Bruce,
That work exactly as I wanted it to.
Many thanks.
Bill.

BruceM said:
Click the control to select it, then click View > Conditional Formatting.
Select "Expression Is" in the leftmost box, then in the box to the right
of that put something like:
[YourField] = -1
Select the font choices you wish to use if the field is True (checked).

YourField is the name of the YesNo field. If you wish to format if the
field is False (unchecked), use 0 instead of -1.

Bill said:
Hi All,

Can anyone tell me how to change the font of text in a text box depending
on the value of a yes/no field on the same form please?

Ta.
Bill
 
B

BruceM

Thanks for the info. I could probably make better use than I do of the
documenter. I wondered if Conditional Formatting was considered to be a
property, but my point was that even if it is a property, it is not set
through the property sheet.

fredg said:
I read the question rather quickly, and did not pick up on the
possibility
that the OP wanted to change the font type. However, it could be
misleading
to refer to a Conditional Formatting property, which does not appear that
I
can see on a control's property sheet.

fredg said:
On Fri, 9 Feb 2007 13:16:35 -0000, Bill wrote:

Hi All,

Can anyone tell me how to change the font of text in a text box
depending
on
the value of a yes/no field on the same form please?

Ta.
Bill

If you want to change the font to Bold or Undertline, etc., or it's
forecolor, use the control's conditional formatting property.

If you wish to actually change the font to a different font name,
you'll need to use code in the check box AfterUpdate event:

If Me![CheckName] = True Then
Me![OtherControlName].FontName = "Times New Roman"
Else
Me![OtherControlName].FontName = "Arial"
End If

Hi Bruce,
Access objects have lots of properties that don't appear on the
property sheet.

Select a control on a form and give it a conditional format.
Save the change. Close the form.

Click on Tools + Analyze + Documenter
Select the form you have that conditional formatted control on and
place a check in it's check box.
Click on the Option button. Make sure the Names and Properties box is
checked (to un-complicate the report, you might want to uncheck
everything else on that Options dialog, otherwise you'll wade through
lots of data). While still in this dialog box, click on Properties.
Select the Format properties and the Other Properties.
Click OK 3 times and you'll see the report.
Find the name of the control you placed the conditional formatting on
and you'll find it's conditional format property listed on the page.

The property does not appear if the control does not have conditional
formatting.
 
B

BruceM

Glad to help.

Bill said:
Bruce,
That work exactly as I wanted it to.
Many thanks.
Bill.

BruceM said:
Click the control to select it, then click View > Conditional Formatting.
Select "Expression Is" in the leftmost box, then in the box to the right
of that put something like:
[YourField] = -1
Select the font choices you wish to use if the field is True (checked).

YourField is the name of the YesNo field. If you wish to format if the
field is False (unchecked), use 0 instead of -1.

Bill said:
Hi All,

Can anyone tell me how to change the font of text in a text box
depending on the value of a yes/no field on the same form please?

Ta.
Bill
 
Top