Filtering a Subform using a Macro

  • Thread starter Thread starter scaramanga
  • Start date Start date
S

scaramanga

Hi,

I've written a simple Macro to apply a filter to a subform. When I ope
the subform directly (i.e. not via another form) the filter run
perfectly. However, when I open it as an object within another form
and run the filter, nothing happens.

The macro has two actions:
SelectObject - to select the subform.
ApplyFilter - to apply the filter (a simple 'Between...And...
expression) to it.

I think it is failing because the SelectObject action can't focus o
the subform when it is running through another form, but I can't thin
of a way around it.

Any suggestions would be extremely helpful
 
Scaramanga,

The SelectObject macro won't work. The form you are using as the
subform is not open, and therefore cannot be selected. You need to use
the GoToControl action to set the focus to the subform control on the
main form... I think that will work
 
Back
Top