Conditional formatting changes field enabled property?

G

Guest

I have a subform control with continuous forms as its default view. I have
the fields on the subform set to .Enabled = False and .Locked = True as I
want to be able to scroll up and down the records but not to be able to
change any data. The records where the conditional formatting conditions
apply appear to have the .Enabled property set to True allowing the cursor to
enter the field.
Does anyone know about this problem?
 
G

Guest

Richard,

In addition to font, type weight, background color, etc., you can also set
the Enabled property for records meeting the specified condition, which
overrides the Enabled status set in form view.

Open the form in form view, click on the control, select Format, Conditional
Formatting, and click the Enabled button at the far right to disable.

Hope that helps.
Sprinks
 
G

Guest

Check if yu have any cde on the on current event of the form that might set
the property of the field to enabled = yes
 
G

Guest

I think Sprinks is right, I tried it, but the problem that the format had
changed.
It showed the fields as gray.
 
G

Guest

Many Thanks Sprinks, and Ofer.
I didn't recognise that when the fields in the Conditional Formatting window
turned grey, it meant that the enabled property of the field was disabled.
Problem solved.
 
A

Access User

I'm getting the same behavior.....I want the "Aneurism" field to be coded
with a green color when it's between 1 and 3 and to take a red background
when it's gt 3. I have set the field to be enabled=no and locked=yes in the
'data' properties of the 'Aneurism' control's in the sub-form where it sits
and it does change colors when I test it before I read this response. I
noticed that in addition to changing colors per the conditional formatting
that it loses it's 'protected' status once I invoked the conditional
formatting, however, unless I'm wrong, clicking the 'enable' button in your
emails had the effect of graying it out. I'm perplexed.
 
A

Access User

That sounds like it could be really useful, but your website's a little
overwhelming, can you please give me a few more details wrt which resource
you're meaning?
 
A

Access User

Thanks, but I don't think it's what I'm needing at the moment based on the
description

A2KConditionalFormatting.zip is a sample MDB demonstrating how to
programmatically setup Conditional Formatting to simulate:

1) Highlighting of the Current Row for a Form in Continuous or Datasheet View

2) Highlighting of Alternate Rows for a Form in Continuous or Datasheet View

Recall, that when I apply a conditional format to a text control on my
sub-form so as to vary the color depending on the numerical value entered
(1-3 = green, gt 3 = red), that the enabled=no and locked=yes properties get
trashed.

Thx.
 
A

Anthony

Stephen, you have code on your website for bringing up a color change tool
that changes the background color of a control. I tried it and it works
GREAT. However, it changes the color of the control for EVERY record. Is
there a way in Access 2003 to change the color of the control for ONLY the
record you have displayed (or in the case of continuous forms or spreadsheet
view, the record that has the focus)? Also, since I am a neophyte VB
programmer I will need to be lead by the hand on the programming of this (if
it is possible to do)
 
D

Douglas J. Steele

The only way would be to use Conditional Formatting (which is what Stephen's
example below is all about)
 
A

Anthony

Thanks Doug for your response. However, using conditional formatting would
change EVERY record that meets the condition. I may only want to change ONE
record. Oh, well. I guess I am thinking too far outside the box.
 
D

Douglas J. Steele

Did you see the first description of what Stephen's example does?
("Highlighting of the Current Row for a Form in Continuous or Datasheet
View")

Did you try it?
 
A

Anthony

OH! SOOOO Close. Stephen's Conditional formatting example ALMOST does what
I need but not quite. He is able to highlight a row and keep it highlighted
after it has lost the focus just how I want but it highlights the whole
record. I only need ONE field in the record highlighted. Also, it appears
you must pre-set the color you want programmatically. I would like to set
the color during run-time using his pop-up color control applet. Stephen
almost has achieved what I need. Maybe a little more tweaking of the code
and combining his color control applet and Viola! we may have it.
However, Doug, I think you may be right that Access does not quite have
the ability to do what I would like.
 
A

Anthony

Thanks. I think that is the situation I have. I have criteria that is too
complex (varied) to be evaluated with the CF Expression. Said another way,
the differences between records is so varied I would need 20 conditional
statements to handle all the different scenarios that can occur in that
field. The CF routine can only handle 3 criteria. Because of that
limitation, I thought it would be easier to just let the user set the field
formatting (color) based on his evaluation of whether it is a exception from
the norm rather than trying to hardcode 20 different exception criteria. I
was wanting to use your color selection applet to accomplish that but it sets
the same color for ALL records - it doesn't allow you to set different colors
for different records. Your conditional formatting VB code almost
accomplished what I need, but it sets ALL fields in one record to the chosen
color, I only need ONE field in the record to be changed. It looks like
Access just doesn't have the capability to do what I want, otherwise someone
with programming ability like you would have already done it.
 
A

Anthony

Thanks. Your right. I could write my own code and I believe I could do it
even with my limited coding cred. I guess it will be 20 "IF-THEN-ELSE"
statements.
I know this thread has gone on for a long time, but if you can give me one
more piece of expertise I would appreciate it. If I do write my own CF code
for 20 conditions, is there a way to let the user - at runtime - choose what
formatting (color, font, etc) he wants the condition to set AND, most
importantly, it will HOLD that user-set formatting forever (until the user
wants to change it) a la Excel even when that form or the database is closed.
I take it that means somehow I will have to save the color in a table
because I don't think you can hard-code a runtime setting.
Thanks
 
A

Anthony

Thank you very much for your advice. Everyone is always so gracious with
advice on these forums. I will check into the Select statement for
programming this. As for setting the color, I was going to use your color
selection applet with the form's Dbl-click event instead of a button.
 
A

AJ

Anthony, go back and reread my previous post in this thread. You are not
limited to evaluating3criteria. You are limited to3fixed
FormatConditions. As I stated in my previous post, you can write your own
function, evaluating as many criteria as desired, and have the function
return True or Flase depending if you want CF to paint the control or not.

--

HTH
Stephen Lebanshttp://www.lebans.comAccessCode, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.




...

read more »

How do I give different colours for different conditions? Pls help.
 

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

Similar Threads


Top