Connecting Tech Pros Worldwide Help | Site Map

Conditional Formatting and Refresh / Requery

midlothian@gmail.com
Guest
 
Posts: n/a
#1: Nov 13 '06
Hello,
I have conditional formatting set up on a subform based on a calculated
value in the underlying query. For instance, if Sales are >$1000, the
query displays "Yes," otherwise it displays "No." The conditional
formatting is set up to read the 'Yes' or 'No' value and color the text
accordingly.

I have an event in the subform that allows users to update the sales.
It actually runs an update query behind the scenes. What I want to
happen is for the formatting to pick up the value immediately and
change color. I can requery the subform, but that loses my place in the
form. And refresh doesn't seem to trigger the conditional formatting to
check for the values.

Is there any way to refresh conditional formatting on the fly?

kingston via AccessMonster.com
Guest
 
Posts: n/a
#2: Nov 13 '06

re: Conditional Formatting and Refresh / Requery


It sounds like the subform isn't refreshing after an update in the main form.
Is this the behavior that you're trying to achieve? It's not clear how
you've implemented this; you should be able to requery the subform without
affecting your main form (Me.SubForm.Requery). Also, have you tried to
requery the control directly? For example, using an AfterUpdate event from
the main form, do something like:

Me.SubForm!Sales.Requery


midlothian@gmail.com wrote:
Quote:
>Hello,
>I have conditional formatting set up on a subform based on a calculated
>value in the underlying query. For instance, if Sales are >$1000, the
>query displays "Yes," otherwise it displays "No." The conditional
>formatting is set up to read the 'Yes' or 'No' value and color the text
>accordingly.
>
>I have an event in the subform that allows users to update the sales.
>It actually runs an update query behind the scenes. What I want to
>happen is for the formatting to pick up the value immediately and
>change color. I can requery the subform, but that loses my place in the
>form. And refresh doesn't seem to trigger the conditional formatting to
>check for the values.
>
>Is there any way to refresh conditional formatting on the fly?
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1

midlothian@gmail.com
Guest
 
Posts: n/a
#3: Nov 13 '06

re: Conditional Formatting and Refresh / Requery



The subform is not connected to the main form. It's just a set of
records. That's why I use the update query to update those records.
The requery and refresh actions I've used are fired 'After Update.'


kingston via AccessMonster.com wrote:
Quote:
It sounds like the subform isn't refreshing after an update in the main form.
Is this the behavior that you're trying to achieve? It's not clear how
you've implemented this; you should be able to requery the subform without
affecting your main form (Me.SubForm.Requery). Also, have you tried to
requery the control directly? For example, using an AfterUpdate event from
the main form, do something like:
>
Me.SubForm!Sales.Requery
>
>
midlothian@gmail.com wrote:
Quote:
Hello,
I have conditional formatting set up on a subform based on a calculated
value in the underlying query. For instance, if Sales are >$1000, the
query displays "Yes," otherwise it displays "No." The conditional
formatting is set up to read the 'Yes' or 'No' value and color the text
accordingly.

I have an event in the subform that allows users to update the sales.
It actually runs an update query behind the scenes. What I want to
happen is for the formatting to pick up the value immediately and
change color. I can requery the subform, but that loses my place in the
form. And refresh doesn't seem to trigger the conditional formatting to
check for the values.

Is there any way to refresh conditional formatting on the fly?
>
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1
kingston via AccessMonster.com
Guest
 
Posts: n/a
#4: Nov 13 '06

re: Conditional Formatting and Refresh / Requery


What do you mean by it's just a set of records? How are you displaying the
data (exposing the table? opening a query? opening a separate form? opening a
report?) The word subform has a specific meaning in Access and it doesn't
sound like you really have a subform. You'll have to go into more detail
about your implementation and what you want to achieve. For example, did you
try a subform (as defined by Access) and decide to do something else because
you didn't want things to work that way?
If you're refreshing a separate form and losing your place, is there an id
that you can use to find your place again after the refresh?

midlothian@gmail.com wrote:
Quote:
>The subform is not connected to the main form. It's just a set of
>records. That's why I use the update query to update those records.
>The requery and refresh actions I've used are fired 'After Update.'
>
Quote:
>It sounds like the subform isn't refreshing after an update in the main form.
>Is this the behavior that you're trying to achieve? It's not clear how
>[quoted text clipped - 24 lines]
Quote:
>Message posted via AccessMonster.com
>http://www.accessmonster.com/Uwe/For...ccess/200611/1
--
Message posted via http://www.accessmonster.com

Darryl Kerkeslager
Guest
 
Posts: n/a
#5: Nov 13 '06

re: Conditional Formatting and Refresh / Requery


You need to use recalc to trigger a refresh of Conditional formatting.

This example demonstrating row highlighting may be of help:

http://www.kerkeslager.net/Darryl/Ac...Highlight.html

--
Darryl Kerkeslager
<midlothian@gmail.comwrote
Quote:
I have conditional formatting set up on a subform based on a calculated
value in the underlying query. For instance, if Sales are >$1000, the
query displays "Yes," otherwise it displays "No." The conditional
formatting is set up to read the 'Yes' or 'No' value and color the text
accordingly.
>
I have an event in the subform that allows users to update the sales.
It actually runs an update query behind the scenes. What I want to
happen is for the formatting to pick up the value immediately and
change color. I can requery the subform, but that loses my place in the
form. And refresh doesn't seem to trigger the conditional formatting to
check for the values.
>
Is there any way to refresh conditional formatting on the fly?
>

Closed Thread