Use Macro to Filter records in Subform on open

  • Thread starter Thread starter RickSF
  • Start date Start date
R

RickSF

I have a Subform that I want to show specific records when I open its main
form via a macro. After opening the form with the OpenForm command, I use
the ApplyFilter command with this Where condition:

[Forms]![BudSpendTransit]![BudSpendTransitSub
Subform].[Form]![BudSpendDetail0QTr]![CashFlowMM]=[CurrMMYY]

The control source for the Subform is the query called "BudSpendDetail0QTr"
containing both the CashFlowMM and CurrMMYY fields.

(The macro's Filter Source is left blank, otherwise the fields of the query
go into the Condition of the main form which does not contain any of the
query's fields.)

The result is records from the prior MM/YY not the current MM/YY. For
example, I get the 12/09 records, not the 01/10 records.

What is the correct syntax to filter records in a subform via a macro?

Thanks for your help.
 
Back
Top