PC Review


Reply
Thread Tools Rate Thread

Currect syntax for ApplyFilter command in Subform

 
 
RickSF
Guest
Posts: n/a
 
      10th Jan 2010
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?
 
Reply With Quote
 
 
 
 
Daryl S
Guest
Posts: n/a
 
      12th Jan 2010
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?

--
Daryl S


"RickSF" wrote:

> 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?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ApplyFilter event on a subform Rob Parker Microsoft Access Form Coding 1 15th May 2008 04:19 AM
ApplyFilter command not working on a subform =?Utf-8?B?RWQgQ3Jhd2ZvcmQ=?= Microsoft Access Forms 9 26th Nov 2006 05:39 PM
applyfilter in subform alecarnero Microsoft Access Forms 2 20th Apr 2006 01:17 PM
Can I use the Applyfilter command to filter a subform and if so, h =?Utf-8?B?Sm9obg==?= Microsoft Access Form Coding 0 16th Mar 2005 07:11 PM
Subform ApplyFilter Problem Jake Jessup Microsoft Access Form Coding 1 12th Aug 2003 01:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:44 AM.