Conditional Formatting - Worked - Bad - Doesn't Work

V

Victor

I set a text box for conditional formatting based on a check box (no check
- normal, checked- bold, red bg, yellow font). I did this to 6 text boxes
(based on 6 check boxes).
This is the code I used:
[Check183].Value=-1

The first time I did one box, it worked, when I coded the other 5, I got
some out of memory error and could not open up the form again. Luckily, I
had a backup (that i created right before playing with this). When I did
one, it didn't work, nor all 6, but it didn't give me the memory error.

Any ideas?

Vic
 
M

Marshall Barton

Victor said:
I set a text box for conditional formatting based on a check box (no check
- normal, checked- bold, red bg, yellow font). I did this to 6 text boxes
(based on 6 check boxes).
This is the code I used:
[Check183].Value=-1

The first time I did one box, it worked, when I coded the other 5, I got
some out of memory error and could not open up the form again. Luckily, I
had a backup (that i created right before playing with this). When I did
one, it didn't work, nor all 6, but it didn't give me the memory error.

I would expect [Check183] = -1 to work IF you are using the
Expression Is option.

If it doesn't, I suspect your form is corrupted. Try
creating a new blank database, set all it's options as
needed (especially that Name Auto Correct is OFF), and then
import everything from the problem database.
 
V

Victor

Thank you so much. I don't know why it worked the first time (this morning)
with [Check183].Value=-1

Quick question, why does it do the formating if = -1, not 1 (yes or
checked)?
May help me in the future :)

Thanks again


Victor said:
I set a text box for conditional formatting based on a check box (no
check - normal, checked- bold, red bg, yellow font). I did this to 6
text boxes (based on 6 check boxes).
This is the code I used:
[Check183].Value=-1

The first time I did one box, it worked, when I coded the other 5, I
got some out of memory error and could not open up the form again.
Luckily, I had a backup (that i created right before playing with
this). When I did one, it didn't work, nor all 6, but it didn't give
me the memory error.

I would expect [Check183] = -1 to work IF you are using the
Expression Is option.

If it doesn't, I suspect your form is corrupted. Try
creating a new blank database, set all it's options as
needed (especially that Name Auto Correct is OFF), and then
import everything from the problem database.
 
J

John W. Vinson

Quick question, why does it do the formating if = -1, not 1 (yes or
checked)?

In an Access JET/ACE backend, a Yes/No field is in fact stored as -1 for Yes,
0 for No.

If the backend is SQL/Server it's possible (but not obligatory) that the field
is a BIT field, with 1 being Yes and 0 being No.
 
V

Victor

Very weird. I coded it as was advised [Check183]=-1 for EXPRESSION IS.
It worked. When I reopened the db up later to do some more work, it doesn't
work now, but the coding for the CF is still there.
????? Can't figure this one.
 
J

John W. Vinson

Very weird. I coded it as was advised [Check183]=-1 for EXPRESSION IS.
It worked. When I reopened the db up later to do some more work, it doesn't
work now, but the coding for the CF is still there.

"Doesn't work" is a bit hard to answer...
 
V

Victor

Very weird. I coded it as was advised [Check183]=-1 for EXPRESSION
IS. It worked. When I reopened the db up later to do some more work,
it doesn't work now, but the coding for the CF is still there.

"Doesn't work" is a bit hard to answer...

Doesn't work as in if I check the box (Check183), it doesn't change the
formating of the text box that I put the conditional code in (Bold, Red BG,
Yellow Font). It worked when I first did it then saved it, closed Access,
opened it later, didn't work. Checked to see if the coding was still there,
it was.
 
V

Victor

It seems cleaning up a few left over prt_click()s solved all my problems.
Thanks for the direction to look into.

Vito/Victor>
 

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