Solved

Filtering records on a subform

Posted on 2011-02-27
7
261 Views
Last Modified: 2012-05-11
I have a Master Form.  On 2 separate tabs I have a sub form on each. I want to be able to see all records related to the Master on SubformA and on  SubformB only the records related to subformA.
 To do this I:
Set the supporting query of subformB with criteria
[Forms]![Master]![SubFormA].[Form]![ID] ‘& FieldID  which is the link between subforms A and B

I setup an ONCurrent Event on the FORM of subformB:
[Forms]![Master]![SubformB].Requery

When I click on tab 3(SubFormB), the First record of subformA shows.  If I change the view of the form to datasheet view…the correct records show.

After all that buildup…..   How can I only see the records associated with subformA when I click on subform B.
Thanks
0
Comment
Question by:ml-sd
  • 4
  • 3
7 Comments
 
LVL 9

Expert Comment

by:rfportilla
ID: 34994404
If your sql is fine, the only thing I would change is how you initiate the requery.  However, you update subform a, use an event there to update subform b.  
0
 

Author Comment

by:ml-sd
ID: 34994418
I am only updating subform B  do i need to update A??
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 34994539
sorry, what I mean is however you are updating subform a, use an event to update subform b.  I'm assuming that what you want is for subform b to update as a result of data in subform a.  I can't give any more detail because I don't know the specifics of what you are doing.  you are telling me that subform b is based on subform a.  Therefore, whenever there is a change in subform a, you should use some kind of an onUpdate event somewhere to requery subform b.  
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:ml-sd
ID: 34999768
I am updating SubformB, based on the record selector in subformA. I do want subform b to update based on a.  I only want the records associated with subform a to show up, when I click on subformB's tab.

Thanks so much for your help.
0
 
LVL 9

Accepted Solution

by:
rfportilla earned 250 total points
ID: 35003795
I see.  Use the "On Current" event in form a.  Set it to requery form b.  When form a switches records, form b will instantly be updated.  
0
 

Author Closing Comment

by:ml-sd
ID: 35014044
Thank You
0
 
LVL 9

Expert Comment

by:rfportilla
ID: 35128223
Glad I could help.  ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now