Conditional formatting

A

andrew3254

Hiya,

I am having trouble getting my conditional formatting to work.
I have some text fields I dont want to enable if a text box is equal to
"Record Locked". I have used the following criteria:
Expression is: [Locked] = "Record Locked"

Even if i use color formatting instead of the enabled button it still doesnt
work.

Does anyone have any ideas?


I have
 
S

Steve Schapel

Andrew,

Please double-check the name of the textbox that you are testing. Is it
named Locked?

If it is, try changing it to something else. 'Locked' is a Reserved Word
(i.e. has a special meaning) in Access, and this may be causing a problem.
 
A

andrew3254

I have changed the name to IsLocked and it still doesnt work.

I have tried using the conditional formatting tot the field of that text box
and it works its just when I reference another text box on that form. I
suspect it could be my expression but I can't see anything wrong with it, I
think I have been staring at it too long.

--
Thank you




Steve Schapel said:
Andrew,

Please double-check the name of the textbox that you are testing. Is it
named Locked?

If it is, try changing it to something else. 'Locked' is a Reserved Word
(i.e. has a special meaning) in Access, and this may be causing a problem.

--
Steve Schapel, Microsoft Access MVP
Hiya,

I am having trouble getting my conditional formatting to work.
I have some text fields I dont want to enable if a text box is equal to
"Record Locked". I have used the following criteria:
Expression is: [Locked] = "Record Locked"

Even if i use color formatting instead of the enabled button it still doesnt
work.

Does anyone have any ideas?


I have
 
S

Steve Schapel

Andrew,

I, also, am having trouble seeing where the problem lies.

You're not referring to a control on a subform, are you?
 
A

andrew3254

Steve,

The form itself is used as a subform but all the fields used in the
conditional formatting are on the same form.

I am re-writing the database into a project linking to SQL Server, the text
box I am referencing sets itself depending on the result of a field on the
server. It is settung itself correctly as I am getting "Record Locked" where
the field RecLock = True.

There are 3 text boxes RecLock, IsLocked, OrderValue; RecLock and OrderValue
are values in a table on the SQL Server, IsLocked is simply a text box used
to display to the user whether it is locked or not, it is not stored in a
table.

The idea I want is if records are locked to disable certain textboxes but as
the user can change the year they are viewing I seem to be having difficulty
changing the text box enable property effectively.
 
S

Steve Schapel

Andrew,

Why can't the Conditional Formatting be performed based on the value of
the RecLock field? What is the purpose of the unbound IsLocked textbox
if all it is doing is reflecting the value of another control?
 
A

andrew3254

Steve,

I have tried doing it based on the bound control and still no joy, tried
every variation for the value (I think), 1, True, "True", 'True'. I just
cant see why the conditional formatting doesn't like

[RecLock] = True (or 1)

The unbound text box is just for display function purposes only, to make it
clear to the user that it is locked as the table value is a boolean data type.
 
A

andrew3254

Steve,

I have solved the problem, hurray, I changeed the expression to the full
form reference:

Forms!frmMajorDetailed!Month1!RecLock = True

I realised it worked when the form opened on its own but when it opened as
the subform it stopped working.

Thank you for your help, it is much appreciated!
 
S

Steve Schapel

Andrew,

If the controls to which the conditional formatting is being applied are
also on the Month1 subform, I can't understand why it is necessary to
qualify the form reference.

But anyway, I'm happy to hear that it's working for you now. :)
 

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