Filter properties not working first time on subform (1 Viewer)

mackyrm

Registered User.
Local time
Today, 10:36
Joined
Oct 5, 2006
Messages
57
I have a form that uses a listbox. I can select multiple items and then update a subform. When I press a button with VBA and use the filter property on the subform for the first time, nothing happens. When I press the button a second time, it does - and it works thereafter with different selections. It only happens that first time, after loading the form and pressing the button for the first time.

I have tested that the list items are accessible via the vba variables and stepping through my code and the problem starts with the filter properties.

the statement:

Me.sbfrmCluster.Form.FilterOn = True
Me.sbfrmCluster.Form.Filter = strFilter


is not switched on first time (I have tried a requery and refresh statement after this). When I step through the code the first time, the FilterOn property remains false. A second button press and it is fine.

What am I missing out?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:36
Joined
Feb 19, 2013
Messages
16,607
it should be the other way round

Me.sbfrmCluster.Form.Filter = strFilter
Me.sbfrmCluster.Form.FilterOn = True
 

mackyrm

Registered User.
Local time
Today, 10:36
Joined
Oct 5, 2006
Messages
57
it should be the other way round

Me.sbfrmCluster.Form.Filter = strFilter
Me.sbfrmCluster.Form.FilterOn = True

So it Should...! :)
 

Users who are viewing this thread

Top Bottom