all I need to run a function that will run multiple reports in different access databases... ad DB to rule them all :) here the structure: in my multi_report.accdb I have a form with a button that is running this code:
Private Sub Comando1_Click()
Dim db_report As String
Dim objAccess As Object
Dim ctr As Date
'TICKETS
db_report = "\\sdocenco01\OPC\11_SCL\TICKETS\ticket.accdb"
Set objAccess = GetObject(db_report) 'opens other db
objAccess.Visible = True
objAccess.Run "report_tickets" 'runs function in other db
objAccess.Quit 'quits other db
Set objAccess = Nothing
'PROCESSI
db_report = "\\sdocenco01\OPC\11_SCL\PROCESSI\utilita.accdb"
Set objAccess = GetObject(db_report)
objAccess.Visible = True
objAccess.Run "report_processi"
objAccess.Quit
Set objAccess = Nothing
...
in the line
objAccess.Run "report_tickets"
i get a run-time error '2517' routine report_tickets not found
I tried different codes like
objAccess.Run "ticket.report_tickets"
or
objAccess.Run "ticket.Database1.report_tickets"
but nothing seems to work
in the \sdocenco01\OPC\11_SCL\TICKETS\ticket.accdb i have this code:
Public Function report_tickets()
DoCmd.SetWarnings False
Dim cdb As DAO.Database, qdf As DAO.QueryDef
Set cdb = CurrentDb
...
End Function