Connecting Tech Pros Worldwide Help | Site Map

Conditional Formatting and Refresh / Requery

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2006, 12:55 PM
midlothian@gmail.com
Guest
 
Posts: n/a
Default 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?


  #2  
Old November 13th, 2006, 01:15 PM
kingston via AccessMonster.com
Guest
 
Posts: n/a
Default 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

  #3  
Old November 13th, 2006, 01:25 PM
midlothian@gmail.com
Guest
 
Posts: n/a
Default 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
  #4  
Old November 13th, 2006, 01:35 PM
kingston via AccessMonster.com
Guest
 
Posts: n/a
Default 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

  #5  
Old November 13th, 2006, 10:45 PM
Darryl Kerkeslager
Guest
 
Posts: n/a
Default 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?
>

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.