I have a form that allows the user to select options for a report. One multiple-selection list box allows the user to select counties- any combination of counties- before clicking up the report that will only include data for those counties.
I had hoped that I could just refer to the field on the form directly in an SQL query- after all, it would just be like a table of values, rather than an individual value, right? Alas, reality and my desires rarely coincide.
I have found two examples:
However, these use VBA code to make the query. I suppose I could do that, add code that adds the other parts of the query using data from all the other controls in the form and then manually change the query string for the report. Or vice versa, write code that creates text from the listbox and inserts it in a hidden control for a regular query to use. But I'm not fond of those options. IS there a simply way to use this in a regular query, or what's the best option?
I had hoped that I could just refer to the field on the form directly in an SQL query- after all, it would just be like a table of values, rather than an individual value, right? Alas, reality and my desires rarely coincide.
I have found two examples:
However, these use VBA code to make the query. I suppose I could do that, add code that adds the other parts of the query using data from all the other controls in the form and then manually change the query string for the report. Or vice versa, write code that creates text from the listbox and inserts it in a hidden control for a regular query to use. But I'm not fond of those options. IS there a simply way to use this in a regular query, or what's the best option?