A
andre_29
Dear all,
I am trying to bring some data from ms access to ms excel and I need
to create a "dynamic" sql code .
I have a form in excel with 4 checkbox: so se user can select: entity,
division, scenario, period.
After this excel will create a query in ms access to bring the data.
The user can select: entity/division/scenario/period or entity/period
or entity or division etc etc etc (a lot of combinations....)
I did this sql code, but I don't know how do it following the user
selection (this code is only if user select entity/division/scenario/
period at the same time):
strSQL = "SELECT entity, division, scenarioperiod, Sum(tbl_sales.qty)
AS qty2, FROM tbl_sales
strSQL = strSQL & "GROUP BY entity, division, scenario, period "
strSQL = strSQL & "HAVING (((tbl_sales.entity) Like '*') AND
((tbl_sales.division) Like '*') AND ((tbl_sales.scenario) Like '*')
AND ((tbl_sales.period) Like '*')) ;"
Thank in advance!!!!!!
André.
I am trying to bring some data from ms access to ms excel and I need
to create a "dynamic" sql code .
I have a form in excel with 4 checkbox: so se user can select: entity,
division, scenario, period.
After this excel will create a query in ms access to bring the data.
The user can select: entity/division/scenario/period or entity/period
or entity or division etc etc etc (a lot of combinations....)
I did this sql code, but I don't know how do it following the user
selection (this code is only if user select entity/division/scenario/
period at the same time):
strSQL = "SELECT entity, division, scenarioperiod, Sum(tbl_sales.qty)
AS qty2, FROM tbl_sales
strSQL = strSQL & "GROUP BY entity, division, scenario, period "
strSQL = strSQL & "HAVING (((tbl_sales.entity) Like '*') AND
((tbl_sales.division) Like '*') AND ((tbl_sales.scenario) Like '*')
AND ((tbl_sales.period) Like '*')) ;"
Thank in advance!!!!!!
André.