Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

track form open and close events by workstation 1

Status
Not open for further replies.

drbobwbic

Technical User
May 14, 2002
2
I Am trying to build a module that will record in table open and close events by COMPUTERNAME for debug purposes,

desired result is a Call to function that says
r!dos = now()
r!workstationname=workstationname
r!formname = formname
r!event = event name IE. "LOAD" or "CLOSE" or "SAVE"

1. get computername works

2. Get screen.activeconrol.name works with exit, save and close
I need a way to classify LOAD event which is not a control

3. get screen.activeform.name fails on LOAD,
but works if screen goes into designview and the back to formview
works on "CLOSE" or "SAVE" event

Any help would be greatly appreciated
Drbob@wbic.org


 
Why not create a sub that takes string values and inserts that into a database for tracking.

Private Sub TrackEvents(sFormName as string, sAction as string)

Dim strSql as string

strSql = "Insert Into tSomeTable (dDate, sForm, sAction) " & _
"Values #" & Now() & "#, '" & sFormName & "', '" & sAction & "';"

SomeMeansOfConnect(strSql)
Ende Sub
 
thanks captand
what my intestion is to create a sub in modules.
my plan was ************
sub ck_event (workstationname as string, formname as string, event_name as string)
dim db as database
set db = currentdb()
dim r as recordset
set r = db.openrecordset("event_log", db_open_dynaset)
r.addnew
r!dos = now()
r!workstationname=workstationname
r!formname = formname
r!event = event name
r.update
r.close
exit sub
*****
in each forms module -- for trackable event
call ck_event (workstationname, formname, eventname)
where each variable is automatically derived. There are 150 forms in this application adn i need to track formload,save, and exit.

i cannot seem to get formname from activeform
i cannot identify an event for load form
thats the rub
 
DrBob,
I don't know if this will help, but try:
Transaction Log for Ms. Access
faq181-291
 
Simple approach to tracking users or computers:
1) Create a log table with fields -- ID, user or computer name, form name, In date, Out date.

2) Assuming a switchboard, on selecting a form from switchboard, use dmax function to identify highest ID # in table, add value of one and pass value to the opened form.

3) In form_open, using ID #, populate new record in table adding the ID #, user/computer name, form name and in Date

4) In form close, populate Out date using ID# to filter.

This has worked successfully for small multi-user database.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top