highlight a record on the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. I have a form which keep track if my clients got paid or not. I am
trying to highlight (or change font color) of the name (which is a text box)
on the form when I clicked the checkbox associate with that record. I put
EventProcedure on that checkbox onClick and change forecolor of the textbox,
but when I clicked on the checkbox, it changes the forecolor of all the
records show on the form instead of only change color of the record I
checked. Any suggestions on how to do it? Thanks a lot!
 
Hi ES,

To prevent the all or nothing formatting that you are experiencing, you have
a couple of options.

1) You can use the Conditional Formatting option availble in the UI by
selecting the controls in question and select Format | Conditional Formatting
from the menu bar.

2) You can create Conditional Formatting objects in code and then apply them
as required through an event.

Either way, you are limited to a total of 4 formats; one default and three
that you are able to change. If you want really fine grained control over
the colors and such, go the code route. For example code, refer to the
following MSDN article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k2/html/odc_conformat.asp

Let me know if you have any questions about this topic.

Lance
 
If you don't have too many states to manage, you could try Conditional
Formatting by either selecting the control in question and selecting "Format
| Conditional Formatting" or you can do the same thing in code.

For more information, along with code, you can check out:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k2/html/odc_conformat.asp

Keep in mind that you are limited to three different conditionals plus one
default (total of four).

Let me know if you have any questions about it.

Lance
 
Hello, Klatuu and KTofsrud. Thank you all for your reply. However, I tried
the condition formatting but it only works on text boxes, not checkbox. Am I
missing something? Thanks again!
 
Unfortunately you are not missing a thing. Conditional formatting is limited
to text and combo boxes; checkboxes will not receive the format. I believe
that CF is an area that a lot of people hope that MS will enhance in the next
version of Access.
 
Hello, LTofsrud. Thanks for your reply. Is there any other suggestions to do
the same job I want? (i.e. when I check the checkbox, it will highlight or
change font color the name of that person ) I am very frustrated. I tried a
lot of methods and didn't work, because of the checkbox problem...
Thanks again!
 
Not that I am aware of. You could check out the site below and check out
some of the examples that are on that site.

http://www.lebans.com/formatbycriteria.htm

As I mentioned before, I can understand the frustration as I would like
better control over this as well. *Hint, hint, Microsoft Access Dev Team*

Good luck.

Lance
 
Back
Top