Solved

Filtering records on a subform

Posted on 2011-02-27
7
260 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

8 Experts available now in Live!

Get 1:1 Help Now