View Full Version : Parameters


Rob.Mills
03-19-2003, 11:20 AM
I've created a simple form to see if I can make this work before I implement it.

On the form I have one textbox and two listboxes.

The first listbox has ten options to choose. I've setup it up so that when you click on an option it will add the option's id to the textbox. Then the form requires both listboxes. The first listbox shows options that are not in the textbox. The other shows ones that are.

So the idea is to click on one and have it taken out of the first box and added to the second. It works fine the first time I add something but not after that.

The first listbox criteria is Not In (Forms!frmTest!txtOptions)

If the textbox says (4,5) then nothing is filtered out. But the weird thing is that if I copy and paste what's in the text box into the criteria it works correctly.

Anyone got any ideas???

Rob.Mills
03-19-2003, 12:11 PM
Anybody??

Pat Hartman
03-19-2003, 12:33 PM
Jet is expecting the parameter - Forms!frmTest!txtOptions - to be a string. Therefore, the result is -
Not In ("4,5") which is NOT the same as
Not In (4,5)

You will need to build the SQL in VBA and modify the contol's RowSource property to get the results you want. You will also need code to concatenate each additional item to the hidden text box.

I'm attaching a sample that does not do exactly what you are trying to do but it may give you an idea. Take a look at the Reports form. The first listbox presents a list of reports from a table. The second listbox shows the reports that were selected for printing. When all desired reports are selected and the print button is pressed, the program analyzes the parameter requirements of the selected reports and opens a dialog to collect the necessary parms. The purpose of this form was to allow the user to select multiple reports for batch printing and to consolidate the parameters rather than having each report prompt separately for parameters.

I made the sample A97 so that it would be useful to the max number of members.

Rob.Mills
03-20-2003, 04:52 AM
Thanks, Pat! I got it working.