Value List question

hafiff

Board Regular
Joined
Feb 5, 2008
Messages
65
I have query that have a criteria coming from a form. For example, the field in query is "Status" and the criteria will be "Active", "Closed" or "Pending".

I have a report form which has a combo box that contains the criteria "*"; "All"; 1; "Active"; 2;"Closed"; 3; "Pending" and the default value is "*''

I also have a macro to generate the report based on the user selected criteria. On the query's criteria, I enter correctly as "Like [Forms]![frmReports].[Status]. It works very well.

The problem is that I don't want "Pending" status on the criteria and I could not this to work. I have tried entering "Like 1 and 2", "Not 3", "Between 1 and 2", but this does not work.

Is there away to generate a criteria just to allow the user to select only either Active and Closed, Active or Closed?

Thanks,
HA
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
["Like 1 and 2", ...like is used with wildcard characters to get records that contain the criteria & would not usually be used with And or Or. Even so, it would not work the way you are writing it.
"Not 3", ...the correct criteria for this would be <>3. So if yo want everything else, this is all you should have to do.
"Between 1 and 2", but this does not work.] ... there is nothing between 1 and 2 in your list

I don't understand why Pending is in the list if you don't want it.
In the query design grid, In("Active","Closed) would give you records that meet either criteria, so that is your second request. If you know how to use the grid like this to get what you need, then make those statements the values for the bound column of your combo box but hide that column. Users will see the visible column where you can use whatever descriptors you want to enlighten the user, but your query would get the statements you have constructed, not what the user is seeing. So your combo needs at least 2 columns. Not sure if the numbers ("1;") you wrote are required too, but you cannot bind more than one column to retrieve data.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,854
Messages
6,162,450
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top