Unanswered: report based on date range and additional field
I have used a sample DB to produce a form where you can select a date range to produce a report. It is working fairly well, however, when I select the dates and click "Open Report", I am prompted to Enter Parameter Value for Part Number and Production Date, which is coming from some extra code in the original sample I used.
I've attached the DB, and if anyone could take a look to tell me how to eliminate that step it would be greatly appreciated. I am new to reports and VBA script!
As well, I would like to include an additional step where the user can produce a report based on the date range AND another field such as SpeciesName or Location.
gbuckton, I don't have time to take a look at your database right now, but this extra parameter is usually caused by a MISSPELLED field name in your query or report, or even a parameter value in a criteria field somewhere that you missed.
You can use VBA code to build a WHERE condition as complex as you'd like. For example:
Dim MyWhere as String
MyWhere = "BeginDate < #" & SomeDate & "# AND EndDate > #" & SomeDate & "# AND SpeciesName='" & SomeName & "'"
Now just throw that into your button. Piece of cake. You can even make those fields (SomeDate, SomeName, etc.) text boxes on your form.
I cover all of this in my advanced Access tutorials.