Results 1 to 8 of 8
  1. #1
    zozzz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    49

    Exclamation Filter Continuous Forms by Combobox

    Hi Everyone



    I have one form and 4 comboboxes in Continuous Form and

    1- I want filtering without make any Query
    2- Limited combobox to another

    I'm very grateful if anyone can Complete the sample


    Click image for larger version. 

Name:	002.png 
Views:	15 
Size:	15.2 KB 
ID:	29824
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try the attached file:
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    zozzz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    49
    hello dear Bob Fitz


    thanks for replay but that is not what I wanted

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by zozzz View Post
    hello dear Bob Fitz


    thanks for replay but that is not what I wanted
    Care to elaborate.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    zozzz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    49
    when I filtered "David" only 35 age should be visible not all ages

    Click image for larger version. 

Name:	0022.jpg 
Views:	13 
Size:	44.8 KB 
ID:	29829

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    when I filtered "David" only 35 age should be visible not all ages

    So do you not want to filter the records on the form?
    Why should only 35 be available?
    What should be available in the other two combo boxes?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Should save birthdate and calculate age.

    You want cascading comboboxes? Each combobox should be dependent on the other 3?

    RowSource for Combo1:
    SELECT DISTINCT Table1.FirstName FROM Table1 WHERE (((Table1.LastName) Like "*" & Forms!form1!Combo2 & "*") And ((Table1.Country) Like "*" & Forms!form1!Combo2 & "*") And ((Table1.Age) Like Nz(Forms!form1!Combo4,"*")));

    RowSource for Combo2:
    SELECT DISTINCT Table1.LastName FROM Table1 WHERE (((Table1.FirstName) Like "*" & [Forms]![form1]![Combo1] & "*") AND ((Table1.Country) Like "*" & [Forms]![form1]![Combo2] & "*") AND ((Table1.Age) Like Nz([Forms]![form1]![Combo4],"*")));

    RowSource for Combo3:
    SELECT DISTINCT Table1.Country FROM Table1 WHERE (((Table1.LastName) Like "*" & [Forms]![form1]![Combo2] & "*") AND ((Table1.FirstName) Like "*" & [Forms]![form1]![Combo1] & "*") AND ((Table1.Age) Like Nz([Forms]![form1]![Combo4],"*")));

    RowSource for Combo4:
    SELECT DISTINCT Table1.Age FROM Table1 WHERE (((Table1.Country) Like Nz([Forms]![form1]![Combo3],"*")) AND ((Table1.LastName) Like "*" & [Forms]![form1]![Combo2] & "*") AND ((Table1.FirstName) Like "*" & [Forms]![form1]![Combo1] & "*"));

    And if you want each combobox to have a null row, use UNION:
    SELECT DISTINCT Table1.FirstName FROM Table1 WHERE (((Table1.LastName) Like "*" & Forms!form1!Combo2 & "*") And ((Table1.Country) Like "*" & Forms!form1!Combo2 & "*") And ((Table1.Age) Like Nz(Forms!form1!Combo4,"*")))
    UNION SELECT Null FROM Table1;

    Must use SQLView of query builder to build UNION statement.

    Then put code in each combobox GotFocus event to Requery itself.

    And probably want a command button with code to reset all comboboxes to Null.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    zozzz is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    49
    hello dear June7


    Thanks for getting back . this is exactly what I wanted

    I Appreciate you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-09-2016, 01:23 PM
  2. Creating a filter for continuous forms
    By NJMike64 in forum Macros
    Replies: 2
    Last Post: 02-17-2016, 10:44 AM
  3. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums