Hello all!
What I need:
Buttons underneath (or even on top) a report that do not scroll away, regardless of the size of the report.
The report is only for viewing its contents on screen, no possible printing involved.
This report also has a dynamic record source and a dynamic filter that both need to be set on loading/opening.
Research:
I've been looking into this quite a bit and it seems a massive undertaking to have the buttons float. And several sources recommend not to do this in any case.
Tried a few of the solutions given and cannot get it to work either. So this seems not the way to go.
The only other thing I can think of to make this work is a form (has footer) with the report as a subreport in the detail. This way the footer stays where it is with the buttons on it. And the report can be just scrolled and viewed.
This works fine, until you count in the fact that it needs a dynamic record source AND a dynamic filter. Either of those work separate, but both together makes Access shiver apparently...
What I have now, including the problem with this:
Made a form called [ReportViewer] with a subreport on it that houses the report we want to view.
The footer of the form has the buttons in it. See screen below here.
So far so good, because this seems to do what I need.
It seems to though, because as soon as you add the dynamic record source and dynamic filter part, it will not work.
Been searching and trying solutions and cannot get the source and filter to work together.
This is the code I have now on the Report load:
My questions:
1. Is there a solution I'm missing that can have the buttons float in a report? Like I said above here; so they stay in place like you have with them in a form in the header or footer?
2. With the current solution the record source and filter together are not working. Am I missing something simple in the code, or is this not possible?
Again some sources say this is possible and others say it is not. The current "Me.RecordSource = strSQL" code is from one of the access forums (might even been from here), which states that it should work.
What I need:
Buttons underneath (or even on top) a report that do not scroll away, regardless of the size of the report.
The report is only for viewing its contents on screen, no possible printing involved.
This report also has a dynamic record source and a dynamic filter that both need to be set on loading/opening.
Research:
I've been looking into this quite a bit and it seems a massive undertaking to have the buttons float. And several sources recommend not to do this in any case.
Tried a few of the solutions given and cannot get it to work either. So this seems not the way to go.
The only other thing I can think of to make this work is a form (has footer) with the report as a subreport in the detail. This way the footer stays where it is with the buttons on it. And the report can be just scrolled and viewed.
This works fine, until you count in the fact that it needs a dynamic record source AND a dynamic filter. Either of those work separate, but both together makes Access shiver apparently...
What I have now, including the problem with this:
Made a form called [ReportViewer] with a subreport on it that houses the report we want to view.
The footer of the form has the buttons in it. See screen below here.
So far so good, because this seems to do what I need.
It seems to though, because as soon as you add the dynamic record source and dynamic filter part, it will not work.
Been searching and trying solutions and cannot get the source and filter to work together.
This is the code I have now on the Report load:
Code:
Private Sub Report_Load()
Dim strSQL As String
'Set the Record Source to match the department.
strSQL = "select * from " & CurrentDepartment & " where [DateTime] Between #" & Format(DateFromText, "mm/dd/yyyy") & "# And #" & Format(DateTillText, "mm/dd/yyyy") & "#"
Me.RecordSource = strSQL
End Sub
My questions:
1. Is there a solution I'm missing that can have the buttons float in a report? Like I said above here; so they stay in place like you have with them in a form in the header or footer?
2. With the current solution the record source and filter together are not working. Am I missing something simple in the code, or is this not possible?
Again some sources say this is possible and others say it is not. The current "Me.RecordSource = strSQL" code is from one of the access forums (might even been from here), which states that it should work.