Hi everyone,
I am very new to access, so I apologize if this is a silly question.
I have set up a report (which I will refer to as the master report) that contains 2 subreports. Both of these subreports obtain their data from the same query. This query is meant to be a filter based on a date range which can be set by the user.
The Date range is determined by two fields ("Start Date" and "End Date") which exist in a separate form.
My objective was to have the user enter the Master Report, and find that all the data available is displayed in the SubReports. The user can then click a command button in the header of the Master Report, which then opens up the Form that holds the "Start Date" and "End Date" fields. When the user selects a start date and an end date within that form, they are then returned to the Master Report. I want another button on the dashboard, which then refreshes the data for the SubReports, so that they will now only display the data that fits in that date range.
I understand that a text filter could normally be used, but I want to eventually be able to implement more complex filters via the form, so this is the approach I want to take.
The way I have approached this problem is to (1) write a macro, which runs upon entry into the Master Report, that sets the "Start Date" and "End Date" values to be a range that captures all the data within the database. (2) I have a command button which opens the form, and then sets the "Start Date" and "End Date" values to be whatever the user inputs.
Here is the problem. Currently, if I am willing to have the user select all the subreports manually, and then hit refresh, it will work. However, I would like a single button in the Master Report which would refresh all the subreports automatically. I have tried a few different approaches to this, but I am honestly stumped. I cannot get it to work.
If anyone can tell me what I need to write in order to automatically refresh the subreports from a command button within the Master Report, I would greatly appreciate that. Alternatively, if anyone has read my approach and sees where I have gone wrong, saying so would also be greatly appreciated! I would not be surprised if there is an easier way to do this, which I have missed due to my inexperience.
Thanks!