Multi-select parameter values from subforms combo box

joe789

Registered User.
Local time
Today, 16:45
Joined
Mar 22, 2001
Messages
154
Hi Folks,

I have a form with a subform (displays all unique values for a certain field in a table) in it and a macro-driven command button that launchs a parameter-value query based on what criteria the user selects from the subform. The program works well, but I can't seem to figure out how to select multiple values from the subform's combo box so that more than one paramter value can be selected at the same time from the combo box (i.e. The user can select more than one value from the combo box as their selection criteria for the query). Is something like this possible? I appreciate any help I can receive.

Thank you very much,

Joe
 
Are you saying you want it to filter based on multiple records in the subform?

Better to use a listbox for that and set it's Multi-select property to either simple or extended.
 
Works with single select, does not work with simple or extended multi-select

This is odd: I have created a list box which displays unique values of field1 in table1 and displays them in a subform. I have linked the subform to a query using the context:

([Forms]![Form1]![List0])

The query works fine, and if a user clicks on the macro-driven query button, whatever the user has selected from the listbox subform is the criteria for the query. However, if I attempt to select simple or extended from the listbox property to enable multi-criteria selection, the query never returns anything.

Am I doing something wrong? I would think if the listbox selection criteria works in non-multi selection mode perfectly, that it should work in multi-select mode also ... that is unless I need to change my parameter value context to something other than:

([Forms]![Form1]![List0])

Thanks for all your help,

Joe
 
Well, I hope you're up for some coding. Once you select more than one in a listbox you can't reference it with a query the same way.

What you have to do is create a sub that cycles through all the selected items, combines them into one string and create the query off of that.

Following?
 

Users who are viewing this thread

Back
Top Bottom