A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Option Group Where Clause



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2007, 02:35 PM posted to microsoft.public.access.forms
Jason
external usenet poster
 
Posts: 713
Default 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  
Old December 4th, 2007, 05:17 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.