Logging the open action of a query from Access to SQL Server

G

Guest

I have written a log function in VBA inside my Access Database. I currently
call the function during the on open events of all forms and reports. The
function takes in one parameter, the name of the object it is recording, then
executes and OLEDB connection to SQL Server and executes an insert statement.
My question: Is it possible to access a similar property as OnOpen event of
a form or report in a query or table? If not is there any way to log the
open action of a table or query?
 
G

Guest

Tables and Queries have no events associated with them. Is it possible to
build a form that exposes the list of tables and queries and trap the event
from there?

Barry
 
G

Guest

You can put the logging function in as a criteria in the query.
Provided the logging function does not take any values from
the query, it will only be called (twice) when the query is opened.

To make sure that the logging function is called, put it in as
a criteria, for example against a field that you know to be
'True'. If you put the function in as a field, it will only be
called if the field is displayed.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top