I found a macro by Ratslinger from 2018 that looks like it will work (for running a report from a form button) and substituted my relevant info, but I get a “Basic Runtime Error - Variable Not Defined” at the Line “oController = Thisdatabasedocument.currentController”. I have defined all the variables, I think. Any ideas on what is stopping me? The macro is shown below. Thanks.
Rem Macro to run a report (Based on a query)
Sub Run_Report
Dim oDrawPage as Object
Dim oForm as Object
Dim oController as Object
Dim oReportdoc as Object
oDrawPage = ThisComponent.getDrawPage()
oForm = oDrawPage.Forms.getByName(“Customer_Form”)
If oForm.IsNew then
oForm.insertRow()
else
oForm.updateRow()
EndIf
oController = Thisdatabasedocument.currentController
if not oController.isconnected then oController.connect
oReportdoc = Thisdatabasedocument.reportdocuments.getbyname(“Job Schedule Report”).open
End Sub