If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Option Group Where Clause
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 |
#2
|
|||
|
|||
Option Group Where Clause
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. -- Dave Hargis, Microsoft Access MVP "Jason" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|