Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Filtering records on a subform

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
ml-sd
Asked:
ml-sd
  • 4
  • 3
1 Solution
 
rfportillaCommented:
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
 
ml-sdAuthor Commented:
I am only updating subform B  do i need to update A??
0
 
rfportillaCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ml-sdAuthor Commented:
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
 
rfportillaCommented:
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
 
ml-sdAuthor Commented:
Thank You
0
 
rfportillaCommented:
Glad I could help.  ;-)
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now