Conditional Formatting Programming

  • Thread starter Thread starter LA Lawyer
  • Start date Start date
L

LA Lawyer

In Access 2007, I want to program the detail fields in a report so that they
will be bolding when the amount field is more than $500.

I am using a form to open the report so this has to be done through VBA.

How is that done?
 
LA Lawyer,
That can be handled by Conditional Formatting. In design mode,
highlight the field you want to Bold, and select Format/Conditional
Formatting from the menu bar.

Expression Is [YourNum] > 500

And then select the Bold button.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Yes, I understand that.

However, I am using the report form for different purposes and sometimes I
want the bolding to be added and sometimes not.

That's why I need a VBA snippet to turn the conditional formatting on and
off.
Al Campagna said:
LA Lawyer,
That can be handled by Conditional Formatting. In design mode,
highlight the field you want to Bold, and select Format/Conditional
Formatting from the menu bar.

Expression Is [YourNum] > 500

And then select the Bold button.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

LA Lawyer said:
In Access 2007, I want to program the detail fields in a report so that
they will be bolding when the amount field is more than $500.

I am using a form to open the report so this has to be done through VBA.

How is that done?
 
Yes, I understand that.

However, I am using the report form for different purposes and sometimes I
want the bolding to be added and sometimes not.

That's why I need a VBA snippet to turn the conditional formatting on and
off.
Al Campagna said:
LA Lawyer,
That can be handled by Conditional Formatting. In design mode,
highlight the field you want to Bold, and select Format/Conditional
Formatting from the menu bar.

Expression Is [YourNum] > 500

And then select the Bold button.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

LA Lawyer said:
In Access 2007, I want to program the detail fields in a report so that
they will be bolding when the amount field is more than $500.

I am using a form to open the report so this has to be done through VBA.

How is that done?

Code the Detail Format event:
Me.[ControlName].FontBold = Me.[OtherControlName] > 500

If you wish to be able to use the exact same report and have the
option to turn Bold on or off from a form, add a check box to the
form. Change the code in the report to:
Me.[ControlName].FontBold = Me.[OtherControlName] > 500 and
forms!FormName!CheckName = -1
Placing a check in the form check box will turn Bold on if the value
is >500. Remove the check and the report control will not be bold even
if the other control's value is > 500.
Remember, however, the form must be open when the report is run.
 
LA Lawyer,A whole different question...
Fred G has the solution using the OnFormat event of the report.
--
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

LA Lawyer said:
Yes, I understand that.

However, I am using the report form for different purposes and sometimes
I want the bolding to be added and sometimes not.

That's why I need a VBA snippet to turn the conditional formatting on and
off.
Al Campagna said:
LA Lawyer,
That can be handled by Conditional Formatting. In design mode,
highlight the field you want to Bold, and select Format/Conditional
Formatting from the menu bar.

Expression Is [YourNum] > 500

And then select the Bold button.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

LA Lawyer said:
In Access 2007, I want to program the detail fields in a report so that
they will be bolding when the amount field is more than $500.

I am using a form to open the report so this has to be done through VBA.

How is that done?
 
L.A. Lawyer; is saying "Thank you" too high a price to pay for
valuable services rendered? The responses you've received in this
thread alone saved you from many hours to many days of research.

Your original post in this thread was promptly answered with a
solution that was right on the mark. Your response was "Oh, yes, I
understand that but what I really want (but didn't tell you) is that
it not only do that but also do this other thing".

Again you received a response that was right on the mark. This time
you not only didn't say "Thank you", you didn't even acknowledge it.

I suggest that you visit www.mvps.org/access and read "Netiquette".
It explains a lot of the quirky behaviors and folkways and
expectations of those of us who hang out in these Access newsgroups.
These newsgroups are provided by microsoft so that they and their
customers get the benefits of peer support from developers at all
levels to developers at all levels. All service here is provided
free of charge by unpaid volunteers. There is one persistent troll
who attempts to prey on newbies. A few interlopers sometimes try it
too. Legitimate service here is limited to helping people over a
single technical hurdle or issue per thread and occasional general
concept and general knowledge about the product at hand. Service for
hire and free consulting and development are not on offer here

Your questions about Access issues are welcome. First make a good
effort to solve your issues yourself and learn to use the resources at
your disposal. Many of the MVPs are the products of self-directed
study: Help files, these newsgroups and (libraries of) books and
newsletters and magazines,

We're not an homogeneous group. We all have different styles of
approach and completeness. We all want to help budding developers
become journeymen and craftsmen/artisans (choose your gender).

HTH
 
Back
Top