Filter Subform

G

Guest

I have a tabbed form with 2 tabs
1st tab is a form based on a query from the "Tracker" table (this was not
placed in tab as a subform, but designed as actual form on 1st tab)
2nd tab is a subform based on tab 1and is its recordsource is CARtbl (table).
They are linked as a 1-to-many relationship by 1st Tracker.ID and
CARtbl.TrackerID.
and the link in the subform (i.e. child/master fields is correct).
The problem I am having is that I can filter ok when on tab1 using ID, but
when on tab2, I cannot filter using ID, keeps giving me an empty/blank record.
 
K

Ken Snell \(MVP\)

You cannot filter on ID field in the subform because it's already being
filtered from the main form through the LinkChildFields and LinkMasterFields
properties of the subform control (if I'm understanding your setup
correctly). Your subform should be showing just the records that contain the
value of ID currently "active" in the main form (tab1). Trying to see other
records with a different value of ID in the subform will give you zero
records because they are not currently part of the subform's data records.
 
G

Guest

Hi Ken,

You are correct.
Even if I try an filter on another field in my subform, that I know has a
record that was created in my subform form and does show up in the CARtbl, I
still get an empty record, and the tab1 does not have any fields filled in
during this filtering.

Is this because any filtering done on either tab1 or tab2 is looking at the
tab1 query?
How can I be able to filter on other fields in the tab2 subform?
Do I have to create a query for the tab2 subform or just use the current
table?

Thank You,
Tim
 
K

Ken Snell \(MVP\)

You've linked the subform on tab2 to the main form on tab1. Therefore, the
record that is active on tab1 will dictate which record(s) can be seen in
the subform -- period.

If you want to be able to see other records in the subform, you either must
put a second subform on the form, or you must eliminate the link between the
main form and the subform.
--

Ken Snell
<MS ACCESS MVP>
 
G

Guest

I was beginning to believe that was the case.

By eliminating the "link" do you mean remove the relationship between the
tables or the link between the form and subform?

If I remove the link on the forms can I still see the subform records that
are associated with the main form record?
 
K

Ken Snell \(MVP\)

Comments inline..

--

Ken Snell
<MS ACCESS MVP>


tlynn said:
I was beginning to believe that was the case.

By eliminating the "link" do you mean remove the relationship between the
tables or the link between the form and subform?

The link created by the use of the LinkChildFields and LinkMasterFields
properties of the subform control.


If I remove the link on the forms can I still see the subform records that
are associated with the main form record?

Only if you program the form in some way to do that. One issue I see -- how
is the subform supposed to know when it should show the records associated
with the main form, and when it is supposed to let you see all records?
 

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