By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

Conditional Formatting and Refresh / Requery

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a

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

P: n/a
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

P: n/a
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.