conditional formatting

G

Guest

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
 
M

Marshall Barton

Newhousg said:
formatting used on forms? Would like to use the concepts
in VB to manipulate six conditions rather than just 3 conditions
Marshall said:
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


Please keep the correspondence in the newsgroups, private
email is reserved for paying clients.

Please note what I said above, there is NO WAY to get more
that the default properties plus 3 sets of conditional
properties (including colors) using Conditional Formatting.

For reports, you can easily use VBA in a section's Format
event to set whatever colors you want.

For Single view forms, you can use VBA in the form's Current
event to set whatever colors you want.

For Continuous forms, there is are a couple of tricky
workarounds that were the only thing available prior to A2K.
See these articles for one way:
http://www.mvps.org/access/forms/frm0024.htm
http://www.mvps.org/access/forms/frm0055.htm

or for another way:
http://www.lebans.com/formatbycriteria.htm
 
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