Find Name of Open Query

vandido626

Registered User.
Local time
Today, 08:13
Joined
Sep 16, 2005
Messages
31
I'm trying to create a usage log with three fields: user, date, and query they used.

I'm able to append the user and date info to a table with problem. However I cant find the function that will append the name of the query the user opened. Can someone tell me how I can do this.
 
Are they opening the query straight from the database window? If so, I know of no way to track that. If you have them opening them from a form, you could code an append to your table there.

FWIW, most of us don't let users see the database window at all, or queries for that matter. We let them see forms and reports, period.
 
Are they opening the query straight from the database window? If so, I know of no way to track that. If you have them opening them from a form, you could code an append to your table there.

FWIW, most of us don't let users see the database window at all, or queries for that matter. We let them see forms and reports, period.

the output file is an excel sheet. the user has a refresh button on the excel sheet and that queries the db. i would like to know who's querying the db from the excel sheet.

i figured i could write code on the excel sheet that would trigger some sort of append query in the db. but, if possible i am trying to avoid rolling out new excel files.
 
Is your button appending the name and date? I can't think of any way other than coding it, I'm afraid. I don't know of anything you could set up on the Access side that would append a record every time the data is queried.
 
The only thing I can think of would be do create some kind of procedure within the BeforeRefresh event of the query table, which would insert log records into a table in the Access database whenever the querytable is refreshed.

Here is a link to the event:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q213187

As far as getting the name of the query being accessed by the querytable, you can use .CommandText to get the SQL being executed. Or, you could hard code the name within the procedure.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom