wtrimble
01-19-2010, 05:38 AM
Hello all,
I have a form with a Subform Query on it. The query right now can be filtered by two Combo Boxes on the form. I need to, however, add 12 Check Boxes to also filter the query and I'm not sure the best way to do this because multiple check boxes need to be checked at one time. All my filtering is done in Query design and not in VB. Here is my SQL I have right now:
SELECT *
FROM tblProjectInfo
WHERE (((MonthName(Month([StartDate])))=[forms].[rptprojectyear].[combo2]) AND ((Year([StartDate]))=[forms].[rptprojectyear].[combo0])) OR (((Year([StartDate]))=[forms].[rptprojectyear].[combo0]) AND (([forms].[rptprojectyear].[combo2]) Is Null)) OR (((MonthName(Month([StartDate])))=[forms].[rptprojectyear].[combo2]) AND (([forms].[rptprojectyear].[combo0]) Is Null)) OR ((([forms].[rptprojectyear].[combo2]) Is Null) AND (([forms].[rptprojectyear].[combo0]) Is Null));
where form "rptprojectYear" is the form with the subform Query. It basically states filter by "Combo0" or don't if "Combo0" is null and filter by "Combo2" or don't if "Combo2" is null. (I'm filtering by Year and Month)
I have a field "Project_Scope" with values like: LPA, NH3, REG, AIG... where I need to filter with checkboxes.
Any suggestions on how to add this extra filter, saying maybe in VB something like: if me.checkboxLPA = true, then SQL = (current)SQL + Where "Project_Scope = "LPA" ??
Thanks for any advice
I have a form with a Subform Query on it. The query right now can be filtered by two Combo Boxes on the form. I need to, however, add 12 Check Boxes to also filter the query and I'm not sure the best way to do this because multiple check boxes need to be checked at one time. All my filtering is done in Query design and not in VB. Here is my SQL I have right now:
SELECT *
FROM tblProjectInfo
WHERE (((MonthName(Month([StartDate])))=[forms].[rptprojectyear].[combo2]) AND ((Year([StartDate]))=[forms].[rptprojectyear].[combo0])) OR (((Year([StartDate]))=[forms].[rptprojectyear].[combo0]) AND (([forms].[rptprojectyear].[combo2]) Is Null)) OR (((MonthName(Month([StartDate])))=[forms].[rptprojectyear].[combo2]) AND (([forms].[rptprojectyear].[combo0]) Is Null)) OR ((([forms].[rptprojectyear].[combo2]) Is Null) AND (([forms].[rptprojectyear].[combo0]) Is Null));
where form "rptprojectYear" is the form with the subform Query. It basically states filter by "Combo0" or don't if "Combo0" is null and filter by "Combo2" or don't if "Combo2" is null. (I'm filtering by Year and Month)
I have a field "Project_Scope" with values like: LPA, NH3, REG, AIG... where I need to filter with checkboxes.
Any suggestions on how to add this extra filter, saying maybe in VB something like: if me.checkboxLPA = true, then SQL = (current)SQL + Where "Project_Scope = "LPA" ??
Thanks for any advice