473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to filter across subforms

sueb
379 256MB
So I have two tables ("Customers" and "Orders") with a 1-to-many relationship between them, and I have a form that shows Customer data with Order data in a subform. However, I notice that with this structure, I can't make a filter (using the built-in filtering mechanism) that collects all Customer/Orders that meet a criteria; I can only filter within a single Customer's Order set.

Must I write a bit of code for every kind of filter my users might want to do? Or would it work differently if I made the Customer data a subform on an Orders main form?

Or am I just thinking about this wrong?
Nov 2 '10 #1

✓ answered by NeoPa

Right Sue. To understand this you need an understanding of Subform controls. These are different from the forms that are used as sub-forms, but they contain the them.

In the properties of the Subform control, you will find two that you need to set to ensure that the sub-form data reflects only those records that match the data in the main form. These two are Link Child Fields and Link Master Fields. If you set these up then it should behave as you expected it should.

9 2007
NeoPa
32,556 Expert Mod 16PB
Sue, this sounds as if you are thinking about this the wrong way. If you have a form that is a subform of another, which is defined by the link between orders and customers, then surely this is not an appropriate place to provide a search/filter mechanism that goes across all customers.

I'm sure it could be done - but is it logically sensible? Will the users not get confused by this schizophrenic approach?
Nov 3 '10 #2
sueb
379 256MB
I'm not sure how the need to gather orders for widgets as opposed to thingamajigs is schizophrenic, but we'll let that pass.

Do you have a suggestion for me?
Nov 3 '10 #3
NeoPa
32,556 Expert Mod 16PB
I know too little of your database to be of much help here, but I would look at providing the functionality via a separate form. Alternatively, you may (I can't know how true this is for you) be able to reuse the Sub-Form as a stand-alone form and just change how it is filtered.
Nov 4 '10 #4
sueb
379 256MB
So I made a form that displays the Orders, with the Customer information as a subform, because usually we are looking through the Orders for status, making notes about scheduling, etc. I didn't foresee this (although it makes sense now that I've done it), but the Customer subform doesn't show (as I had hoped) the Customer for the Order I'm looking at, but the entire Customer database.

How do I restrict the subform to the Customer linked with the Order being displayed?
Nov 11 '10 #5
NeoPa
32,556 Expert Mod 16PB
Right Sue. To understand this you need an understanding of Subform controls. These are different from the forms that are used as sub-forms, but they contain the them.

In the properties of the Subform control, you will find two that you need to set to ensure that the sub-form data reflects only those records that match the data in the main form. These two are Link Child Fields and Link Master Fields. If you set these up then it should behave as you expected it should.
Nov 12 '10 #6
sueb
379 256MB
Wow, that is exactly what I needed, NeoPa! And I don't know that I would have EVER stumbled across that on my own--I am so grateful to you and the other experts on this site.

Thanks!
Nov 12 '10 #7
NeoPa
32,556 Expert Mod 16PB
It's my pleasure to help Sue.

Sometimes, just looking at the results created after running a wizard, can give a lot of understanding about how various typical setups work.
Nov 12 '10 #8
sueb
379 256MB
You are so right, NeoPa! I only wish my actual job were managing this (and other databases) so that I had enough time to really take advantage of what Access is telling me. As it is, I'm expected to do this "in my spare time." HA!
Nov 13 '10 #9
NeoPa
32,556 Expert Mod 16PB
I can't think of anything more fun than working in Access for your spare time :-D
Nov 14 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JJMM | last post by:
Hi, I have a form (form1) with a large number of subforms inside it (around 20 subforms), There is the possibility of filtering the data using a pop-up form that create/change a query (all the...
3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
0
by: Arnold | last post by:
Hi there, I have a form to organize bottles in mind, but am unsure if it will work. Here's some background info: Mainform = frmProduct, which contains fields for pricing, status, etc. of...
3
by: Oliver Spiesshofer | last post by:
Hi, I have an unbound form with two bound subforms. If data in one of the subforms is updated, I want the other one to be requeried. How do I do that? I tried the a function doing
8
by: Zlatko Matić | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load...
5
by: kkrizl | last post by:
I have a form that shows burglar alarm permits. I have a subform that shows the alarms that have occurred at the location of the permit (linked by permit number). There is a different fine schedule...
2
by: Katie | last post by:
I need to store a history of two fields in two seperate tables: Event - where the key is Event_ID Stage - where the key is Stage_ID The joins are: Main Table Event Table Stage Table ...
9
by: frys | last post by:
Access 2003 Windows XP I have a form that is for tracking attendance at programs. the main form is the program information, and the sub form is the attendance information. I have 5 homes...
2
by: Constantine AI | last post by:
Hi can anybody help? I have a main form with customer details on that links to a sales order head subform through the customer ID. The sales order head subform is then linked to the sales order...
4
by: Rich P | last post by:
Maybe you could try using a query as the recordsource for your subforms and for the criteria field in the query you could use a Form parameter. This way - instead of using the form filter property...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.