Solved

Filtering records on a subform

Posted on 2011-02-27
7
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

728 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