Currect syntax for ApplyFilter command in Subform

R

RickSF

I have a form containing a subform that I want to filter for specific records
when I open the main form via a macro. The Control Source for the Subform is
a query called: BudSpendDetail0QTr that contains the two fields CashFlowMM
and CurrMMYY.

The syntax in the Where condition is:
[Forms]![BudSpendTransit]![BudSpendTransitSub
Subform].[Form]![BudSpendDetail0QTr]![CashFlowMM]=[CurrMMYY]

The result I get is not for the current month (example 01/10) but the prior
month (12/09).

The subform is not linked to the main form, so I leave the Fiter Name blank.
(Otherwise, the condition goes into the properties of the main form, and I
get errors becasue the fields in the query are not in the main form's control
source.)

What is the correct syntax to filter the query that controls the subform?
 
D

Daryl S

Rick -

What do you get if you just run the query BudSpendDetail0QTr? The criteria
you have would only restrict this set to where the CurrMMYY = CashFlowMM. Is
the CurrMMYY in the query pulling the current month/year dynamically, and is
it correct?
 

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