hey everybody,
i'm developing a database and on several forms I have multiple combo boxes. i want a user to choose from the 5 combo boxes and then pull a report based on those combo boxes. The 5 combo boxes are: cbZip, cbDay, cbSic, cbRegion, & cbType. If a user just wants to see a report by day, then they'll leave all combo boxes empty except cbDay. i have some code in there but it only works if the user selects data from each combo box. here's the code i've got. All help is greatly appreciated.
strSQL = "SELECT * Into Top50 From tblTemp WHERE Zip = cbZip.Value AND Day = cbDay.Value AND Sic = cbSic.Value AND Region = cbRegion.Value AND Type = cbType.Value " & _
"Order by tblTemp.Net Desc;"
i'm developing a database and on several forms I have multiple combo boxes. i want a user to choose from the 5 combo boxes and then pull a report based on those combo boxes. The 5 combo boxes are: cbZip, cbDay, cbSic, cbRegion, & cbType. If a user just wants to see a report by day, then they'll leave all combo boxes empty except cbDay. i have some code in there but it only works if the user selects data from each combo box. here's the code i've got. All help is greatly appreciated.
strSQL = "SELECT * Into Top50 From tblTemp WHERE Zip = cbZip.Value AND Day = cbDay.Value AND Sic = cbSic.Value AND Region = cbRegion.Value AND Type = cbType.Value " & _
"Order by tblTemp.Net Desc;"