Sub report with pass thru datasource

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PCGram
    New Member
    • Oct 2022
    • 1

    Sub report with pass thru datasource

    I am updating an old Access application with a backend sql server.

    In a report, I have a subreport based on a very complex query. I would like to run the data source as a pass-thru query.

    When I do, I get this error:

    "You cannot use a pass-through query or a non-fixed column crosstab query as a record source for a subform or subreport."

    It also says that I need to specify the column headers, but that only applies to crosstabs.

    In 2011, a guy wrote "I found a solution to this part. I made a function that returns a recordset, and then I bind this recordset to the form's recordset." But when I open the subreport and execute this:
    Code:
    Me.Recordset = MyFunction(SomeSQL)
    I get an error saying that this functionality (assigning a recordset using vba) is only available/allowed in ADP.

    Any ideas?
Working...