Filtering a Subform using a Macro

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
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top