combo box w/criteria in the row source to show all previous entries even when the criteria doesn't match

Posted on 2014-08-21
Last Modified: 2014-09-02
I have an Access 2010 database with a combo box in a subform that is in datasheet view.  In the row source of the combo box I have a query that limits the entries in the combo box based on criteria that it gets from the main form.  This part works correctly.  The problem I am having is that previous records in the datasheet subform don't show the entries in the combo box field if the criteria in the current record doesn't match.  For example:  the main form has a field called "Origin".  This data may change or it may stay the same depending on the unique circumstances of the record.  In the combo box on the subform I tell it it to look at the data in the "Origin" field and filter the set of data that populates in the combo box according to the data.  Because "Origin" can change, the entries that show up in the combo box changes too.  When this happens all the records with that combo box field are blank.  Help, please.
Question by:animallover
    LVL 48

    Expert Comment

    by:Gustav Brock
    This is done using the OnEnter and OnExit events of the combobox:

      OnEnter, set the filter as you do now for the current record.
      OnExit, remove the filter so all options will be showed.

    LVL 33

    Accepted Solution

    I created a sample database to explain the problem and show one possible solution.  The format is .mdb since the problem has existed forever.

    Author Closing Comment

    Thank you.   This is exactly what I was looking for.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    MsgBox 2 29
    Access - LDB lock file 4 24
    Running Sum Help 31 22
    Ensuring all processes are complete before continuing 6 14
    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now