| re: Invalid field or expression problem
Oh wait! i forgot to mention that queryB also references the combo box. In fact queryB IS the first half of queryA (as in, if you remove the union and the bit after that in queryA, that's queryB).
And i personally don't think that regenerating the query every time the combobox value is changed to hard code the value of the combo box into it is very good. Firstly that defeats the purpose of that part of the query being a dynamic parameter. It also means that whatever parameter is chosen last will carry over still hard-coded into the query for next time the form is open and if the user doesn't change the value in the combo from it's default (which may NOT be the value currently in the query) then the query will still run the values for last time. Of course you could re-write the query when the form is opened up so that the query will go back to the default value, however it doesn't seem like a very good practise to me.
Is there another way to get around this problem still using a dynamic parameter? Maybe if i changed the parameter to being a normal dynamic parameter (as opposed to its current combo-box reference), is there a way to parse parameters through when a query is run, like with a stored procedure?
e.g. queryA (parameter1, parameter2,...)
|