Conditional Formatting

A

andrew3254

Hiya,

I have some text boxes on a form which I want to add conditional formatting
to lock them if a textbox has a value True.

I have tried the following expression but it doesnt seem to work, even if I
try putting True in quotes.

[Forms]![frmMajorDetailed]![sub]![Month3]![IsLocked] = True

Month3 is a subform on sub which is a subform on frmMajorDetailed. Sounds
messy I know but its the only way I could think of getting a cross-tab style
form.

The database is written in an Access project file which links to a SQL
Server back-end.

If i reference the value in the textbox it seems to like conditional
formatting but when I try using values in other text boxes it doesnt like it.

Does anyone have any ideas?
 
J

Jeff Boyce

If I recall, the underlying data in True/False fields is ... -1 and 0
(respectively).

Have you tried setting it to -1?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Douglas J. Steele

To be honest, I'm not sure you can lock using conditional formatting, but if
you can, you need to make the following corrections:

First, make sure of the names of the subform controls. Depending on how you
added the forms as subforms, the name of the subform control may be
different than the name of the form being used as a subform. You need to be
referencing the subform control name.

Second, use the .Form property of the subform control.

[Forms]![frmMajorDetailed]![sub].Form![Month3].Form![IsLocked] = True
 
A

andrew3254

No that doesn't work I have tried adding a new textbox with a different name
and it still doesnt like that one.


--
Thank you




Jeff Boyce said:
If I recall, the underlying data in True/False fields is ... -1 and 0
(respectively).

Have you tried setting it to -1?

Regards

Jeff Boyce
Microsoft Office/Access MVP

andrew3254 said:
Hiya,

I have some text boxes on a form which I want to add conditional
formatting
to lock them if a textbox has a value True.

I have tried the following expression but it doesnt seem to work, even if
I
try putting True in quotes.

[Forms]![frmMajorDetailed]![sub]![Month3]![IsLocked] = True

Month3 is a subform on sub which is a subform on frmMajorDetailed. Sounds
messy I know but its the only way I could think of getting a cross-tab
style
form.

The database is written in an Access project file which links to a SQL
Server back-end.

If i reference the value in the textbox it seems to like conditional
formatting but when I try using values in other text boxes it doesnt like
it.

Does anyone have any ideas?
 
A

andrew3254

You can enable/disable the textbox.

I have tried using the .Form property and that doesnt work. I have opened
up the sub form on its own and changed the conditional formatting expression
to reference the field on itself and that still doesnt work.

I dont know if it is a problem referencing the boolean value or a problem
referencing the textbox. The value seems to being pulled from the table ok.

--
Thank you




Douglas J. Steele said:
To be honest, I'm not sure you can lock using conditional formatting, but if
you can, you need to make the following corrections:

First, make sure of the names of the subform controls. Depending on how you
added the forms as subforms, the name of the subform control may be
different than the name of the form being used as a subform. You need to be
referencing the subform control name.

Second, use the .Form property of the subform control.

[Forms]![frmMajorDetailed]![sub].Form![Month3].Form![IsLocked] = True


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


andrew3254 said:
Hiya,

I have some text boxes on a form which I want to add conditional
formatting
to lock them if a textbox has a value True.

I have tried the following expression but it doesnt seem to work, even if
I
try putting True in quotes.

[Forms]![frmMajorDetailed]![sub]![Month3]![IsLocked] = True

Month3 is a subform on sub which is a subform on frmMajorDetailed. Sounds
messy I know but its the only way I could think of getting a cross-tab
style
form.

The database is written in an Access project file which links to a SQL
Server back-end.

If i reference the value in the textbox it seems to like conditional
formatting but when I try using values in other text boxes it doesnt like
it.

Does anyone have any ideas?
 

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