Is it possible to run a macro from a query in ACCESS 2013?
I need to run it just by clicking on the query, I do not know if this is possible with clauses such as PROCEDURE, EXECUTE ...
-
.
Attending the suggestion of calling the macro with a function that in turn calls a Sub, try the following
Function funcion1()
Call proc1
End Function
Sub proc1()
DoCmd.OpenQuery "Consulta1", acViewNormal, acReadOnly
DoCmd.Close acQuery, "consulta1"
DoCmd.OpenQuery "Consulta2", acViewNormal, acReadOnly
End Sub
Each one works perfectly when I run them from VBA, but I tried to call them from the query with
SELECT funcion1()
But mark an error '2486' this action can not be executed now
Now my main question to the suggestion is: is Select
the correct way to call the function from the SQL window? Or what clause should I use?