B
brwn.fred
Hi,
I have a form whose data source is a very slow query.
I want to bring up the form with an initial filter without executing
my slow query twice. It appears that if I invoke the form with:
DoCmd.OpenForm "Form", WhereCondition:="Filter", it comes up with
Filter on and the data is queried only once.
I would prefer though to be able to apply the filter within the form
itself and then it can be invoked without the invoker knowing the
specifics of the Filter.
I tried in the form open procedure:
Me.Filter = "Filter": Me.FilterOn = true
This makes a requery happen. I tried applying the filter and then
setting Me.RecordSource. This resulted in the Filter not getting
applied although the query was only run once.
Is there a way to do what OpenForm does from within the code of a
form?
Thanks,
Fred Brown
I have a form whose data source is a very slow query.
I want to bring up the form with an initial filter without executing
my slow query twice. It appears that if I invoke the form with:
DoCmd.OpenForm "Form", WhereCondition:="Filter", it comes up with
Filter on and the data is queried only once.
I would prefer though to be able to apply the filter within the form
itself and then it can be invoked without the invoker knowing the
specifics of the Filter.
I tried in the form open procedure:
Me.Filter = "Filter": Me.FilterOn = true
This makes a requery happen. I tried applying the filter and then
setting Me.RecordSource. This resulted in the Filter not getting
applied although the query was only run once.
Is there a way to do what OpenForm does from within the code of a
form?
Thanks,
Fred Brown