All, I have an Access 2003 front end link to tables in Sql Server 2008. I have three different separate divisions within this database. I have pass thru queries based on information in these divisions. I want to use a form for users to select a division, select a date range and output the results to an excel file to the user’s desktop or any folder they wish. I created a form that has unbound forms to select a division, year and two date ranges for beginning month end month. I am having trouble with putting the code together. I can get the code to run separately, but not together:case "ShortTerm" = "qrySTReports"case "LongTerm"="qryLTReports"case "Term"="qryAllTerm"stDocName = "qrySTReports" DoCmd.OpenQuery stDocName, acNormal, acEdit DoCmd.OutputTo acOutputTable, "qrySTReports", acFormatXLSX
Dim strWhere As String strWhereY="[cboYear]strWhere = "[MonthProcessed] Between " & Format(Me.txtBeginDate, "\#mm\/dd\/yyyy\#) & " And " & Format(Me.txtEndDate, "\#mm\/dd\/yyyy\#")
I am trying to put this together based on multiple criteria on the form. Does anyone do anything similar; please help.Thanks