multiple criteria form

slimjen1

Registered User.
Local time
Today, 13:13
Joined
Jun 13, 2006
Messages
562
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. When running both; just returns all records no error messages:


Code:
case "ShortTerm" = "qrySTReports"
case "LongTerm"="qryLTReports"
case "Term"="qryAllTerm"
stDocName = "qrySTReports"
    DoCmd.OpenQuery stDocName, acNormal, acEdit
    DoCmd.OutputTo acOutputTable, "qrySTReports", acFormatXLSX



Code:
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
 

Users who are viewing this thread

Back
Top Bottom