Re: Conditional formatting changes field enabled property?

Tech-Archive recommends: Speed Up your PC by fixing your registry



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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Anthony" <Anthony@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0F74288A-A7DF-49D0-9C69-F5D2D10277A0@xxxxxxxxxxxxxxxx
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
spread***
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)

"Stephen Lebans" wrote:

I pointed you to that solution so you could see how to programmatically
setup the FormatConditions object. I never stated there was a solution
specific to your requirements. If you take the time to actually open the
code you will see what I am referring you to.

Good luck with your issue.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Access User" <AccessUser@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:287035CF-3053-4C64-891C-19699B33829C@xxxxxxxxxxxxxxxx
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
Data***
View

2) Highlighting of Alternate Rows for a Form in Continuous or Data***
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.

"Stephen Lebans" wrote:

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

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Access User" <AccessUser@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B80F745A-C909-4B2D-BA18-85F1C4AFE57D@xxxxxxxxxxxxxxxx
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?

"Stephen Lebans" wrote:

If I remember correctly, in some versions of Access, the Enabled
property
is
not respected when you set it via the Conditional Formatting UI.
You
need
to
programmatically set the FormatConditions object to work around
this
Bug.
There is sample code on my site showing you how to do this.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Access User" <AccessUser@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
news:8A16123A-EF1A-4B6C-8105-CBDAFB542428@xxxxxxxxxxxxxxxx
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.

"Ofer" wrote:

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


--
\\// Live Long and Prosper \\//
BS"D


"Ofer" wrote:

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

--
\\// Live Long and Prosper \\//
BS"D


"Richard Corner" wrote:

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?











.


Quantcast