Conditional Formatting Does not Refresh On Subform Using Datepicker (1 Viewer)

pghcpa

New member
Local time
Today, 02:47
Joined
Jan 19, 2014
Messages
3
Main form has a text box with datepicker.

TextBox AfterUpdate event uses textbox value to change recordsource in subform then refreshes the subform which contains conditional formatting.

If I type-in a date and press TAB to leave the textbox, everything works as expected.

If I use the datepicker to choose the date then press TAB, the conditional formatting in the subform does not refresh until I click the mouse in the subform.

I have tried every form of requery, refresh and recalc in many events in main form and subform (load, open, activate) But since it works fine when the date is typed in, none of the obvious solutions like this work.

I have seen a few posts describing this scenario but no good solutions. The only one I have seen that might work is to momentarily open a small dummy popup window. Is there are a better solution or this this a confirmed bug?
 

MarkK

bit cruncher
Local time
Today, 02:47
Joined
Mar 17, 2004
Messages
8,180
For a detailed thing like this I recommend you post a database that demonstrates the problem. Troubleshooting this without being able to reproduce the problem will be tough, and I don't have the inclination to write the system I would need to write to test it.
hth
Mark
 

pghcpa

New member
Local time
Today, 02:47
Joined
Jan 19, 2014
Messages
3
Thx, that is a reasonable suggestion and the problem is easy to replicate. For now, I moved the recordsource setting/refresh behind a button on the main form. So user must enter/select date then press button instead of just tabbing out of the textbox. I just thought someone else might have run into this before. (I've been at this a very long time and rarely run into something I can't solve, so I am sort of curious. I have used this combination before but probably never noticed the special condition for a datepicker giving a different result.)
 

MarkK

bit cruncher
Local time
Today, 02:47
Joined
Mar 17, 2004
Messages
8,180
Well, the offer stands. If you post something, I'll take a look.
Cheers,
Mark
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:47
Joined
May 7, 2009
Messages
19,226
Create a module wise boolean variable:

Option compare database
Option explicit

Dim bolTextChange as boolean

'""
On enter event of the textbox set the variable to false
On change event set the varuable to true.
On ext event of the textbox chk the variable if it is true and change recird source uf it is.
 

Users who are viewing this thread

Top Bottom