Option Group Where Clause

J

Jason

Thanks to help from this group I now have an option group on a from that
allows me to select which subform to display. The code to do that is list
below

Private Sub Frame51_AfterUpdate()
Select Case Me.Frame51
Case 1
Me.EmployeeSubformcontrol.SourceObject = "Frm_EmployeePhone"
Case 2
Me.EmployeeSubformcontrol.SourceObject = "Frm_EmployeeCerts"
Case 3
Me.EmployeeSubformcontrol.SourceObject = "Frm_EmploymentData"
End Select

End Sub

When I call the subform it returns all the data from the tbl. I would like
to limit the data to what is related to the Mainform. How can I add a where
clause to the above statement that would return the filtered information.

The Main form field is
Frm_EmployeeEditPage.QI

The subform’s field is

Frm_EmployeePhone.QINumber
Frm_EmployeeCerts.[QI Number]
Frm_EmploymentData.QI

Thank you
 
K

Klatuu

It would not be a where clause.
You use the Link Master Fields and Link Child Fields properties of the
subform control to identify the relationships between the main form data and
the subform data. In your code, you will have to identify those properties
when you change subforms.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top