Conditional Formatting and Refresh / Requery

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • midlothian@gmail.com

    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?

  • kingston via AccessMonster.com

    #2
    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.Req uery). Also, have you tried to
    requery the control directly? For example, using an AfterUpdate event from
    the main form, do something like:

    Me.SubForm!Sale s.Requery


    midlothian@gmai l.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.c om


    Comment

    • midlothian@gmail.com

      #3
      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.c om 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.Req uery). Also, have you tried to
      requery the control directly? For example, using an AfterUpdate event from
      the main form, do something like:
      >
      Me.SubForm!Sale s.Requery
      >
      >
      midlothian@gmai l.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.c om
      http://www.accessmonster.com/Uwe/For...ccess/200611/1

      Comment

      • kingston via AccessMonster.com

        #4
        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@gmai l.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.c om
        >http://www.accessmonster.com/Uwe/For...ccess/200611/1
        --
        Message posted via http://www.accessmonster.com

        Comment

        • Darryl Kerkeslager

          #5
          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:



          --
          Darryl Kerkeslager
          <midlothian@gma il.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?
          >

          Comment

          Working...