473,722 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

filter by form/subform

In reading some of the posts on this group, it appears as though it is
not strait forward at all to filter a form, which has subforms, by
criteria which are either on subforms or span more than one
subform.....

This MSDN article however makes it sound as simple as clicking "Filter
by Form", entering the search criterial in the form and/or it's
subforms, then just clicking "Apply Filter"......

http://support.microsoft.com/default...b;en-us;304259

I know from experience that this doesn't work.
Searching by items on the main form is fine....once you try to search
by criteria on the subforms, it just gives you ALL the records.......

Am I just missing something?

(Using Access 2003)

Doug

Nov 13 '05 #1
3 11967
dh*****@daubert .com wrote:
In reading some of the posts on this group, it appears as though it is
not strait forward at all to filter a form, which has subforms, by
criteria which are either on subforms or span more than one
subform.....

This MSDN article however makes it sound as simple as clicking "Filter
by Form", entering the search criterial in the form and/or it's
subforms, then just clicking "Apply Filter"......

http://support.microsoft.com/default...b;en-us;304259

I know from experience that this doesn't work.
Searching by items on the main form is fine....once you try to search
by criteria on the subforms, it just gives you ALL the records.......

Am I just missing something?


You do realize that when you apply a filter to the subform it does NOT restrict
what records you will see in the main form right? Filtering the subform simply
tells Access "As I am looking at main records, limit the records in the subform
to this filter".

It is possible to filter the main form based on criteria of records found in the
subform, but none of the built in "quick and easy" filter tools will accomplish
this. You have to use the advanced filter tool and use a subquery or create the
filter in code or change the RecordSource of the main form to a query that joins
to the table for the subform records so that criteria can be applied to those
fields.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #2
dh*****@daubert .com wrote:
In reading some of the posts on this group, it appears as though it is
not strait forward at all to filter a form, which has subforms, by
criteria which are either on subforms or span more than one
subform.....

This MSDN article however makes it sound as simple as clicking "Filter
by Form", entering the search criterial in the form and/or it's
subforms, then just clicking "Apply Filter"......

http://support.microsoft.com/default...b;en-us;304259

I know from experience that this doesn't work.
Searching by items on the main form is fine....once you try to search
by criteria on the subforms, it just gives you ALL the records.......

Am I just missing something?

(Using Access 2003)

Doug


You can show only records on the main form that contain items on a
subform by setting the RecordSource of the main form with something like
this in code:

Form_Main.Recor dSource = CurrentDb.Query Defs(MyQuery).S QL

....with the appropriate JOIN in MyQuery.

I suppose you could further refine this by setting the RecordSource of a
subform, but I've never tried it.
--
Smartin
Nov 13 '05 #3
See:
Filter a Form on a Field in a Subform
at:
http://allenbrowne.com/ser-28.html

The article describes how to create a quzai-filter on the main form by
changing its RecordSource to an inner join statement, such that it contains
only those records that have a match in the subform.

An alternative approach is to use a subquery in the Filter string. Since the
Filter is effectively a WHERE clause, anything you can use in a WHERE clause
is allowed in the form's Filter string. If subqueries are new, see:
How to Create and Use Subqueries
at:
http://support.microsoft.com/?id=209066

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@dauber t.com> wrote in message
news:11******** ************@o1 3g2000cwo.googl egroups.com...
In reading some of the posts on this group, it appears as though it is
not strait forward at all to filter a form, which has subforms, by
criteria which are either on subforms or span more than one
subform.....

This MSDN article however makes it sound as simple as clicking "Filter
by Form", entering the search criterial in the form and/or it's
subforms, then just clicking "Apply Filter"......

http://support.microsoft.com/default...b;en-us;304259

I know from experience that this doesn't work.
Searching by items on the main form is fine....once you try to search
by criteria on the subforms, it just gives you ALL the records.......

Am I just missing something?

(Using Access 2003)

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7850
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside from queries. Let me just add that Allen Browne excellent article about this subject may not apply to this scenario on an elementary level. (Here's the link to the article; Filter a Form on a Field in a Subform -...
2
9799
by: Andante.in.Blue | last post by:
Hi everyone! I was wondering if there is a away to use Access 97's build in filter-by-form function but restrict its effect to just the subform. I have a parent form that shows the major divisions of the company, and a subform that is linked so that it displays all the jobs within the division in the parent form. I also want the ability to filter the subform, so the users can pick out a bunch of common jobs easily. I did this using a...
7
6285
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals. I can do this the first time the form loads.
3
2769
by: Tony Williams | last post by:
Sorry to repost but I cannot work this out. Can anyone come up with a suggestion? I have a main form based on Table1. The form has a tab control of three pages. Each page has a subform based on a different table ie subform1 based on Table2, subform2 based on Table3 and subform3 based on Table4. I want the user to be able to use the Filter By Form facility in Access but this does not work when trying to select controls on the main form AND...
2
2843
by: cefrancke | last post by:
I have a form (no underlying record set) that has two separate sub-forms on it. Each sub-form has data from two different tables. Above each sub-form there is one unbound combo box with a SQL record source that returns an ID field and a Text field. Next to each combo box is two buttons, one that 'Applys' the filter of the sub-form to the value in the combo box and one that 'Clears' the form's current filter. When the click event of the...
2
4030
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another form. Everything works fine, except for the "Filter by form" feature. When the user tries to use Filter by form a messagebox is displayed: "There are too many controls in this form to perform a filter by form", after that,when the user exit the Filter by Form mode, Access crash, displaying a...
0
1759
by: Stinky Pete | last post by:
Hi, The db I'm trying to update has a report form from which all other statistical forms and reports are selected/printed by dept, type, cost, number etc. The report form uses a date filter to generate the necessary data and you can also addtionally filter by by individual department/s, supplier/s if you so wish which is great However, I'm trying to develop an individual statistical form that for one subform uses the date filter as...
0
1696
by: diogenes | last post by:
"Rick Brandt" <rickbrandt2@hotmail.comwrote in news:bPnKj.456$%41.325 @nlpi064.nbdc.sbc.com: I used this approach, and it works a treat! ID In(SELECT Order_ID FROM orderitems WHERE NAME = 'product') I've not used an In clause before. Thanks a lot for the education.
1
6797
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes bits of code for different examples. I have one last thing to finish. I am trying to create a search form that will allow users to select criteria from multiple sources eg ,multi select list boxes , combo boxes. I have a subform showing all the...
0
8863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9238
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4502
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.