Applying a select query for a combo box with criteria from a form.

Posted on 2012-08-30
Last Modified: 2012-08-30
Good morning!

I have a combo box on a form which I am having problem with the selct query for the data.

Esentially, this combo box is a look up of the records currently available to the form.  I use a radial button to apply a filter to the form and I ask for the combox box to requery after the filter is applied, however i can't seem to format the criteria statement correctly in the select query.

This is my criteria for my Employment Status field in the Select Query of the combo box.

IIf([Forms]![Employee Details]![RBtn_Show_Inactive]=False,"active",)

When the button is false (or filtered), only records with "active" are selected, however when I remove the filter, I want all records to show.  Using the statement above, no records are selected.  

I've also tried to format the False part of the IIF statement with options like "*", "Active" AND "Inactive", Not Null...nothing seems to return all the records.  I can ask for another criteria such has "Inactive" and it will select those records so I know the IFF statement is correct.

What am I doing wrong?
Question by:MCaliebe
    LVL 61

    Accepted Solution

    Try placing this in the criteria:

    LIKE  IIf([Forms]![Employee Details]![RBtn_Show_Inactive]=False,"active", "*")

    Open in new window


    Author Closing Comment

    Simple fix.  Makes sense now that I see it.  Thanks for your help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now