Not sure if I'm missing some big concept here...
I have a pretty big query that is used as a rowsource for a listbox.
I want to filter this listbox/query in lots of different ways based on
different buttons I press from around the screen. I know that I can
copy the sql from this query into a listbox.rowsource line in VB, and
add the WHERE condition to the end of the SQL code for each different
OnClick event procedure.
The problem is that this is a pretty hefty SQL statement, and once I
copy it into each procedure, it is then very tedious to modify if I
need to make a change (which I often need to do because this whole
project is constantly evolving) because of a) the size of it, and b)
the fact that it is redundantly written into so many different
procedures.
I would love to just have one same query that I can call from each
different procedure, and then ADD a where statement onto each
procedure's query reference, without have to "explode" the query into
SQL for each reference to it.
Is there some way I can do this? Some filter method I'm not aware of?
Thanks!
I have a pretty big query that is used as a rowsource for a listbox.
I want to filter this listbox/query in lots of different ways based on
different buttons I press from around the screen. I know that I can
copy the sql from this query into a listbox.rowsource line in VB, and
add the WHERE condition to the end of the SQL code for each different
OnClick event procedure.
The problem is that this is a pretty hefty SQL statement, and once I
copy it into each procedure, it is then very tedious to modify if I
need to make a change (which I often need to do because this whole
project is constantly evolving) because of a) the size of it, and b)
the fact that it is redundantly written into so many different
procedures.
I would love to just have one same query that I can call from each
different procedure, and then ADD a where statement onto each
procedure's query reference, without have to "explode" the query into
SQL for each reference to it.
Is there some way I can do this? Some filter method I'm not aware of?
Thanks!