u can write code to open report in the button's click event. just write
"docmd.openreport" and spacebar, it will open a help of the function below ur code and u can write wht u want to do.
This is the way I do it though there may be a better way. Create the button by dropping it from the toolbox. In the button properties event tab click the builder beside on click (...) and choose macro builder. Name the macro and in ACTION navigate to and select open report (or query or whatever). In action arguments name the report and make the view print preview.
As I said, there may be a better way but this works. You'll have to do one for each button, possibly there is a way to have one macro do it, anyone?
Open the form, that comes with the button that results in the error when clicked, in design mode.
Right click anywhere in the form and select Properties.
Now, select the button.
Navigate to the tab page called "Event"
In the On Click event, it will show [Event Procedure]
Click in the field, an icon with 3dots appears.
Click on thr icon, this will open the Microsoft Visual Basic editor.
Remove your erraneous code, that is, remove these lines
Code:
SELECT
FROM Query([Litters per year])
WHERE Month = [date?]
Now click on Save in the menu bar.
Next, try again adding a new button to your form as per the previous replies.
Also consider some reading / courses on VBA