conditional formatting

N

Newhousg

Is there a way to view the code that is used for conditional formatting used on forms? Would like to use the concepts in VB to manipulate six conditions rather than just 3 conditions
 
M

Marshall Barton

Newhousg said:
Is there a way to view the code that is used for conditional formatting used on forms? Would like to use the concepts in VB to manipulate six conditions rather than just 3 conditions


I hope you don't really mean VB since Conditional Formatting
is a feature in Office apps. If you mean VBA for Access,
then you can use a function call in the Expression Is box.
The function can then test any number of conditions (and you
can see the code too ;-))

Note that there is no way to specify more than the default
and 3 conditional sets of property settings
 
J

Jim/Chris

How about somethin like this.

Private Sub cboMyCombo_AfterUpdate()
Me.txtBox1.FontWeight = IIf(Me.cboMyCombo = "value1",
"Normal","Bold")
Me.txtBox2.FontWeight = IIf(Me.cboMyCombo = "value2",
"Normal","Bold")
Me.txtBox3.FontWeight = IIf(Me.cboMyCombo = "value3",
"Normal","Bold")
Me.txtBox4.FontWeight = IIf(Me.cboMyCombo = "value4",
"Normal","Bold")
Me.txtBox5.FontWeight = IIf(Me.cboMyCombo = "value5",
"Normal","Bold")
Me.txtBox6.FontWeight = IIf(Me.cboMyCombo = "value6",
"Normal","Bold")
End Sub

Jim

Private Sub Form_Current()
Call cboMyCombo_AfterUpdate
End Sub
-----Original Message-----
Is there a way to view the code that is used for
conditional formatting used on forms? Would like to use the
concepts in VB to manipulate six conditions rather than
just 3 conditions
 

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