G
Guest
Hi!
I created four simple select queries, Query1, Query2, Query3, Query4 - each
query uses the same table but retrieves a unique set of records. Then i
created a continuous form, and slapped FOUR Checkboxs, box1, box2, box3, box4
onto the forms header. And on their onclick event, each checkbox changes the
forms recordsource to the corresponding query. For example, clicking on
checkbox1 sets me.form.recordsource = "Query1" or clicking on checkbox 3 sets
me.form.recordsource = "Query3".
However, if the user selects more then one checkbox, say checkbox1 &
checkbox4 id like the queries to combine and display the resulting records on
the continous form.
So, with my limited knowledge of MSACCESS, to acheive this, i create & saved
**SIXTEEN (or so)** seperate UNION queries inorder to cover any possible
combination of the four original queries.
"Query1 + Query2"
"Query1 + Query2 + Query3"
"Query1 + Query2 + Query3 + Query4"
"Query1 + Query3 + Query4"
"Query1 + Query4"
"Query2 + Query3 + Query4"
"Query2 + Query3"
"Query1 + Query4" ..etc
....then in the Checkboxs ONCLICK event, i called a VBA procedure which i
wrote (a massive collection of IF Statements ) that verifies which checkboxs
are selected and THEN changes the forms recordsource to the appropriate query.
QUESTION:
i was hoping there was an easy way in VBA, rather then having to create &
save every possible combination of the four originaly queries, to combine
qeuries or add recordsets. Perhaps something like, me.form.recordsource =
"query1" + "query2" or maybe something like me.form.recordsource =
"query1" UNION "query4" or perhaps me.form.recordset (??) =
theRecordSetReturnFromQuery1 + TheRecordSetFromQuery3...
Id like to get around saving the original select statements in a NEW query
everytime i want to "UNION" them with each other... having to save them
everytime makes for a long list of queries in the database window when they
are pratically made up of identical SQL code.
err, im i making any sense?
id like to be brighter.
WebDude
(jeff)
I created four simple select queries, Query1, Query2, Query3, Query4 - each
query uses the same table but retrieves a unique set of records. Then i
created a continuous form, and slapped FOUR Checkboxs, box1, box2, box3, box4
onto the forms header. And on their onclick event, each checkbox changes the
forms recordsource to the corresponding query. For example, clicking on
checkbox1 sets me.form.recordsource = "Query1" or clicking on checkbox 3 sets
me.form.recordsource = "Query3".
However, if the user selects more then one checkbox, say checkbox1 &
checkbox4 id like the queries to combine and display the resulting records on
the continous form.
So, with my limited knowledge of MSACCESS, to acheive this, i create & saved
**SIXTEEN (or so)** seperate UNION queries inorder to cover any possible
combination of the four original queries.
"Query1 + Query2"
"Query1 + Query2 + Query3"
"Query1 + Query2 + Query3 + Query4"
"Query1 + Query3 + Query4"
"Query1 + Query4"
"Query2 + Query3 + Query4"
"Query2 + Query3"
"Query1 + Query4" ..etc
....then in the Checkboxs ONCLICK event, i called a VBA procedure which i
wrote (a massive collection of IF Statements ) that verifies which checkboxs
are selected and THEN changes the forms recordsource to the appropriate query.
QUESTION:
i was hoping there was an easy way in VBA, rather then having to create &
save every possible combination of the four originaly queries, to combine
qeuries or add recordsets. Perhaps something like, me.form.recordsource =
"query1" + "query2" or maybe something like me.form.recordsource =
"query1" UNION "query4" or perhaps me.form.recordset (??) =
theRecordSetReturnFromQuery1 + TheRecordSetFromQuery3...
Id like to get around saving the original select statements in a NEW query
everytime i want to "UNION" them with each other... having to save them
everytime makes for a long list of queries in the database window when they
are pratically made up of identical SQL code.
err, im i making any sense?
id like to be brighter.
WebDude
(jeff)