Conditional formatting

N

Norbert Meiss

I use an continuous form with a conditionally formatted text field. The text
in the field depends on the value of another field in the same record. When I
update this other field, the text changes as expected. However the text color
only changes to the corresponding condition when I move to another record
with the mouse, not when I use the tab or enter key.
What do I miss?
TIA,
Norbert Meiss
 
A

Al Campagna

Norbert,
Even though you enter (or change) a value on a record, those changes are
not wriiten to the table until an Update or Refresh or Requery occurs.
Moving from one record to another "forces" an Update.
In your case, try a Refresh on the AfterUpdate event of your field.
That should cause an Update while still on the same record, and allow the
C/F to kick in.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
N

Norbert Meiss

Al,
I should have mentioned that there is only one updateable field in each
record. So in both cases (either clicking into another line or using the tab
or enter key) saves the record. I already tried a refresh on the
conditionally formatted field. That doesn't work either...

But finally I found out, that a "DoCmd.Requery" in the AfterUpdate does the
trick.

Thanks, Norbert
 
A

Al Campagna

Norbert,
Yes, I should have included Requery as a possible solution, particularly
when dealing with subforms, lists, or combo boxes..
Thought I'd suggest Refresh first...
Good deal.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 

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