468,115 Members | 1,962 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

Conditional Formatting and Refresh / Requery

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?

Nov 13 '06 #1
4 11652
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
mi********@gmail.com wrote:
>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

Nov 13 '06 #2

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:
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
mi********@gmail.com wrote:
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
Nov 13 '06 #3
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?

mi********@gmail.com wrote:
>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.'
>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]
>Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200611/1
--
Message posted via http://www.accessmonster.com

Nov 13 '06 #4
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
<mi********@gmail.comwrote
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?

Nov 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Bradley | last post: by
8 posts views Thread by Dimitri Furman | last post: by
3 posts views Thread by HateSpam | last post: by
5 posts views Thread by Andrew Chanter | last post: by
reply views Thread by GGerard | last post: by
7 posts views Thread by Andy_Khosravi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.