I tried the following - it almost works. The problem is that it is calling the query, and the report, and the query parameter window. I'd like it to just call the parameter form and then preview the report.
This is the code on the OK button in the form:
Private Sub OK_Click()
Me.Visible = False
DoCmd.OpenQuery "qryBudgetByRegion", acViewNormal, acEdit
DoCmd.OpenReport "qryBudgetByRegion", acViewPreview
'DoCmd.Close acForm, "Select Region", acSaveNo
End Sub
Yes, the names are the same. I'll clean them up when this all works. I added a line to close the query window which works but I am still getting the query parameters. I'll take another look at what you suggested. Where does this code go?
SELECT tblSales.*
FROM tblSales
WHERE SaleDate Between Forms!frmDates![txStartDate] and Forms!frmDates![txtEndDate]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.