Filter By Form Using Subform Fields 
Author Message
 Filter By Form Using Subform Fields

1. Is there a way to use the Filter-by-Form feature on a SubForm?

2. I have two tables, Contacts and Contact Types.

3. I have a main Contacts form, with a ContactTypes datasheet subform ,
linked on field ContactID.  There can be multiple contact types for each
ContactID.

4. I want to be able to use Filter-By-Form to filter records of a particular
Contact Type.  However, the feature does not appear to work on subforms.

Thanks very much for any advice.

Alan

_________________
Alan Z. Scharf
GrapeVine Systems
New York City

http://www.*-*-*.com/



Thu, 22 Mar 2001 03:00:00 GMT  
 Filter By Form Using Subform Fields
If you only have a single criteria, you can code it yourself pretty easily.
Include an unbound combo box in the main form's header where the user can
select the contact type they want to view. Then in it's AfterUpdate event,
set the form's filter or recordset to add a where clause: "contactID IN
(SELECT contactID from Contact_ContactType WHERE contactType=" & cboFilter &
")". Your code should remove the filter if cboFilter is Null. You can also
use a multi-select list box for the filter if you want to let the user pick
more than one contact type at a time, but the code gets a little more
involved.
--
Paul Shapiro

Quote:

>1. Is there a way to use the Filter-by-Form feature on a SubForm?

>2. I have two tables, Contacts and Contact Types.

>3. I have a main Contacts form, with a ContactTypes datasheet subform ,
>linked on field ContactID.  There can be multiple contact types for each
>ContactID.

>4. I want to be able to use Filter-By-Form to filter records of a
particular
>Contact Type.  However, the feature does not appear to work on subforms.



Thu, 22 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Applying a filter on a form filters subforms, too

2. Filter Querry on Subform using calender control

3. Form goes to 1st record when filter applied to subform

4. Help: Form/Subform filter

5. Requery a Combo Box on a Subform When Filtering the Main Form in Access 7.0

6. Using a main form to control the edit properties of a subform using VBA

7. Referencing a field on a SubForm within a Subform

8. updating a field in a form from a subform

9. Subform linked by autonumber field in main form

10. Want to add record with form when subform field is changed

11. navigating for keyboard users - subfrom to form - subform to subform

12. changing the sourceobject of subform when the form and subform are loaded

 

 
Powered by phpBB® Forum Software