M
MKammerer via AccessMonster.com
Currently I have a form that searches my main table using a user defined
filter which is stored to a sting variable. The best part of that is that I
can then use that string variable to pass as the filter for a report
generation. This all works nicely as long as the search form remains the
subform of the main form which contains the button that generates the report.
The next thing I would like to do is create a dynamic title on the report
that says what the user searched for, in other words display the filter.
However since the full text of the filter string doesn't look very good as
the title of the report I have added an additional algorithm to the search
form that generates another string explaining the search the user specified
in more lengthy text which looks better as a report title. Anyway the
problem is getting this search description string into the report to display
it properly. I can send the filter string to the report using this code:
DoCmd.OpenReport stDocName, acViewPreview, , [filterString]
I even took the time to save the search description string to a table which
is the data source of the main form where the button is that creates the
report, so the button has access to the filter decription but passing it to
the report is giving me trouble.
filter which is stored to a sting variable. The best part of that is that I
can then use that string variable to pass as the filter for a report
generation. This all works nicely as long as the search form remains the
subform of the main form which contains the button that generates the report.
The next thing I would like to do is create a dynamic title on the report
that says what the user searched for, in other words display the filter.
However since the full text of the filter string doesn't look very good as
the title of the report I have added an additional algorithm to the search
form that generates another string explaining the search the user specified
in more lengthy text which looks better as a report title. Anyway the
problem is getting this search description string into the report to display
it properly. I can send the filter string to the report using this code:
DoCmd.OpenReport stDocName, acViewPreview, , [filterString]
I even took the time to save the search description string to a table which
is the data source of the main form where the button is that creates the
report, so the button has access to the filter decription but passing it to
the report is giving me trouble.