stardustvega
Member
- Local time
- Today, 02:52
- Joined
- Feb 4, 2022
- Messages
- 36
I have a dynamic query which is generated by a function (it updates every day). When my parent report loads, I want it to pull in the subreport using this query.
Currently, I'm using this code:
I've verified that the query is correct.
When I try to run this code, I get "Compile error: Method or data member not found".
I also found this thread: Similar issue, and based on that, I tried changing the last line to
That generates an error of: "Run-time error '2467': The expression you entered refers to an object that is closed or doesn't exist."
I have verified that the subreport is indeed named S_RecurSub.
Currently, I'm using this code:
Code:
Private Sub Report_Load()
Dim dailyQ As String
dailyQ = GetDailies()
S_RecurSub.SourceObject = "Report.S_Repeat"
S_RecurSub.RecordSource = dailyQ
End Sub
I've verified that the query is correct.
When I try to run this code, I get "Compile error: Method or data member not found".
I also found this thread: Similar issue, and based on that, I tried changing the last line to
Code:
Me.S_RecurSub.Form.RecordSource = dailyQ
That generates an error of: "Run-time error '2467': The expression you entered refers to an object that is closed or doesn't exist."
I have verified that the subreport is indeed named S_RecurSub.