Solved

Filtering records on a subform

Posted on 2011-02-27
7
262 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

773 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