Updating conditional formatting on a continuous subform

  • Thread starter Thread starter Remi Despres
  • Start date Start date
R

Remi Despres

Interesting problem.

I've got an unbound continuous subform that uses conditional
formatting. The condition it depends on is defined, in part, by a
combobox on its' parent form.

When the combobox is updated, I have the subform refresh itself. I
know this isn't really Refresh's raison d'être, but I've found that
this makes the subform's conditional formatting be reevaluated - in
least for visible rows. The problem is that any rows not currently
visible aren't updated. When the user moves around on the subform, the
conditional formatting is thus no longer correct.

Can anyone offer any advice on how this should be done? There must be
a better way than this...

(Currently, I work around this problem by Refreshing the subform with
the MouseWheel event. I also use the timer event, to have the subform
refresh itself regularly, since I can't know when the user has
scrolled up or down on the subform.)

PS - I'm using Access XP.
 
How about requerying the subform?

Interesting problem.

I've got an unbound continuous subform that uses conditional
formatting. The condition it depends on is defined, in part, by a
combobox on its' parent form.

When the combobox is updated, I have the subform refresh itself. I
know this isn't really Refresh's raison d'être, but I've found that
this makes the subform's conditional formatting be reevaluated - in
least for visible rows. The problem is that any rows not currently
visible aren't updated. When the user moves around on the subform, the
conditional formatting is thus no longer correct.

Can anyone offer any advice on how this should be done? There must be
a better way than this...

(Currently, I work around this problem by Refreshing the subform with
the MouseWheel event. I also use the timer event, to have the subform
refresh itself regularly, since I can't know when the user has
scrolled up or down on the subform.)

PS - I'm using Access XP.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Hi Andy.
I am aware of Stephen's site and his excellent work. Might be a good
idea for me to take some time and peruse once again...

Thanks,
R/mi.
 
Hi John.
Thanks for the reply.

I'd briefly tried using Requery rather than Refresh, but dropped it.
Requery makes my subform jump back up to the first record, which is
visually a bit distracting (particularly considering that the contents
of the subform never change, except for the Yes/No checkbox in
existing records). The only differences (according to MSDN) between
the two is that requery is supposed to reflect added or deleted
records from the record source. Since this is never going to be the
case for me, I went with Refresh.

Course, I tried that out before my current problem came to light.

Thanks for the thought; I'm going to see if Requery does better work
of it. Otherwise, I'll just stick to my current solution.

Best regards,
R/mi.

John Nurick said:
How about requerying the subform?

Interesting problem.

I've got an unbound continuous subform that uses conditional
formatting. The condition it depends on is defined, in part, by a
combobox on its' parent form.

When the combobox is updated, I have the subform refresh itself. I
know this isn't really Refresh's raison d'être, but I've found that
this makes the subform's conditional formatting be reevaluated - in
least for visible rows. The problem is that any rows not currently
visible aren't updated. When the user moves around on the subform, the
conditional formatting is thus no longer correct.

Can anyone offer any advice on how this should be done? There must be
a better way than this...

(Currently, I work around this problem by Refreshing the subform with
the MouseWheel event. I also use the timer event, to have the subform
refresh itself regularly, since I can't know when the user has
scrolled up or down on the subform.)

PS - I'm using Access XP.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Back
Top