[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2012-08-30
Medium Priority
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

mbizup earned 600 total points
ID: 38350054
Try placing this in the criteria:

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

Open in new window


Author Closing Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

834 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