OnOpen Event of a query

  • Thread starter Thread starter NathanJ
  • Start date Start date
N

NathanJ

I would like to run a function during the open event of a query.
Currently I am only able to run the function on reports and forms. Is
there any possible way to access the same event of a query, or does
anyone have a way to run a log function when a query is openned?
 
NathanJ a écrit :
I would like to run a function during the open event of a query.
Currently I am only able to run the function on reports and forms. Is
there any possible way to access the same event of a query, or does
anyone have a way to run a log function when a query is openned?

Hi NathanJ,

I'm afraid there is no such a thing as a "On Open" event for the query
object. Actually, queries are not programmable objects that can be
customized like a form or a report.

I can't think of an elegant workaround for this. Maybe if you tell us
what you want achieve we could help further.

Mathieu Pagé
(e-mail address removed)
 
My Ultimate gaol is to be able to run a custom function
LogAction(*NameOfObject*), which opens a recordset and inserts
information into our SQL Server, for everytime a query or table is
openned.
 
My Ultimate gaol is to be able to run a custom function
LogAction(*NameOfObject*), which opens a recordset and inserts
information into our SQL Server, for everytime a query or table is
openned.


Only if you were to prevent ALL ways to open them except via a form or method
that you provide and then have that method also do the SQL insert.
 
Rick Brandt a écrit :
My Ultimate gaol is to be able to run a custom function
LogAction(*NameOfObject*), which opens a recordset and inserts
information into our SQL Server, for everytime a query or table is
openned.


Only if you were to prevent ALL ways to open them except via a form or method
that you provide and then have that method also do the SQL insert.

Yep, that's the inelegant workaround I was thinking of. I don't think
there is any other way to do what the OP want.
 
Back
Top