Results 1 to 6 of 6
  1. #1
    Exmark1 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Location
    Tennessee
    Posts
    7

    Filter form records with a combo box

    I have a relational Database in Access 2007 for Lawn Service customers , and on my main form called customer information which is a single form, I want to have a combo box with Active, Inactive , and All to be able to select and I could alternate between each group.
    In the forms control source select query I have a field called Status where every customer is either active or inactive. Currently to see my inactive customers I have to open another form call Inactive customers with Record source Inactive customer query, and I thought it would be neat to be able to toggle from active to inactive or All customers on the same form .



    I am new to Access so if anyone has a solution to how to do this I would appreciate the help

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If you want to search for the status you have to provide an UNBOUND combo or text box that lists the status, then when the value is changed (either ON CHANGE or ON EXIT property of the unbound combo) you would requery your form.

  3. #3
    Exmark1 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Location
    Tennessee
    Posts
    7
    I do have a unbound combo box that displays the Active and Inactive status from a cross tab query when I select the drop down, and I have in the Change property of the combo box me.requery that does not work to requery the form and display inactive customers. the form displays active customers when opened anyway.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    the query driving the form must have a criteria in the 'status' field of [forms]![formname]![statusfield] or requerying will have no visible effect.

  5. #5
    Exmark1 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jan 2015
    Location
    Tennessee
    Posts
    7
    I am lost on this one what would the criteria reference. the combo box is in the form header of my ' Customer Information Form' is named Status. Which is populated with Active and Inactive choices by a crosstab query . This form data is from "active customer query" which has the Status Field. [Forms]![Customer Information]![Status]
    Confused help!

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,964
    Form has RecordSource, data controls (textbox, combobox, etc) have ControlSource. Is the CROSSTAB a RecordSource or ControlSource?

    A CROSSTAB query is seldom practical for form RecordSource as data cannot be edited. CROSSTAB query requires parameter definition for filtering, review http://allenbrowne.com/ser-67.html#Param

    Since there is no value "All" in the data, selecting that from combobox will not filter records - no records match that criteria. Review http://www.allenbrowne.com/ser-62.html
    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.

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

Similar Threads

  1. Combo box to filter records in a subform
    By dannybeaver in forum Access
    Replies: 9
    Last Post: 08-27-2014, 02:14 AM
  2. Replies: 3
    Last Post: 11-27-2012, 07:20 AM
  3. Filter form records by Date with Combo box
    By jhrBanker in forum Forms
    Replies: 2
    Last Post: 07-31-2012, 01:19 PM
  4. Replies: 3
    Last Post: 06-02-2012, 07:39 PM
  5. Filter Form records with Combo Box????
    By jgelpi in forum Forms
    Replies: 0
    Last Post: 05-19-2009, 07:05 AM

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