PC Review


Reply
Thread Tools Rate Thread

ApplyFilter gives error only when subform is placed on main form

 
 
Rachel Garrett
Guest
Posts: n/a
 
      11th Aug 2011
Hello,

I've got a subform which is successful with ApplyFilter on loading by itself.

However, when I place that subform onto a main form, I get the error message, "[Comments].[Dimension_ID] is not a vaild expression." It asks me to type in a parameter, which doesn't work.

Any ideas why ApplyFilter would behave differently depending on whether the subform is loading on its own, or being loaded from a main form?

Thanks,
Rachel
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      11th Aug 2011
On Thu, 11 Aug 2011 10:48:59 -0700 (PDT), Rachel Garrett <(E-Mail Removed)>
wrote:

>Hello,
>
>I've got a subform which is successful with ApplyFilter on loading by itself.
>
>However, when I place that subform onto a main form, I get the error message, "[Comments].[Dimension_ID] is not a vaild expression." It asks me to type in a parameter, which doesn't work.
>
>Any ideas why ApplyFilter would behave differently depending on whether the subform is loading on its own, or being loaded from a main form?
>
>Thanks,
>Rachel


Probably because you're not referencing the subform correctly - you didn't
post your code so it is hard to be sure!

The correct syntax for referencing the control Dimension_ID on the subform
named Comments is

Me![Comments].Form![Dimension_ID]

Note that Comments here is the Name property *of the Subform Control*, the box
on the mainform; the name of the form object within that box is irrelevant (it
might be Comments or some other name, but it's not used, just the name of the
Subform Control objext).
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/For...-US/accessdev/
http://social.answers.microsoft.com/.../en-US/addbuz/
and see also http://www.utteraccess.com
 
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
Requery main form after subform update and not lose place in main form. Michael Microsoft Access Form Coding 1 23rd Nov 2010 09:26 PM
subform to main form formula #Error Revned Microsoft Access Form Coding 2 9th Aug 2009 05:37 AM
VB error 2137 when trying to add second subform to main form =?Utf-8?B?Q2h1Y2tX?= Microsoft Access Form Coding 1 10th May 2006 06:01 PM
#Error When using a subform field on a main form... =?Utf-8?B?QnJvb2s=?= Microsoft Access Form Coding 2 24th Nov 2005 07:06 AM
Subform Calculated Sum with Error on Main form Dkline Microsoft Access Forms 6 18th Mar 2004 08:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 PM.