|
Notes: |
This file demonstrates how you can record Excel VBA process activity in an
Access database. |
|
|
|
|
|
|
Use it to log user activity, providing an audit trail for their protection
as well as your own. |
| |
|
|
|
Identify programming bottlenecks. |
|
|
|
|
|
Important: |
If you move this code into another workbook, you will need to ensure it
includes a reference to DAO 3.51 |
|
|
(In VBA, Tools >
References) |
|
|
|
|
|
|
You will need a copy of Microsoft's Access. |
|
|
|
|
|
Versions: |
Excel 97 and Access 97 |
|
|
|
|
|
Filenames: |
ALF.xls |
This file |
|
|
ALF.mdb |
Access file |
|
|
|
|
|
Install: |
Copy this workbook and the Access database |
|
|
into the same directory |
|
|
|
|
|
Use: |
To use this in your own work: |
|
|
Copy the ALF code into your workbook. |
|
|
Put a copy of ALF.mdb is in your workbook's directory. |
|
|
Create a reference to DAO 3.6 |
|
|
Run Test_ALF to ensure it's recording. |
|
|
Put references to ALF in strategic positions in your code. |
|
|
|
|
|
Code Notes: |
The code consists of three procedures: |
|
|
|
Test_ALF |
|
|
|
ALF |
|
|
|
ViewAccessDatabase |
|
|
|
|
|
|
The code contains all the documentation. |
|
|
|
|
|
|
|
|
|
Access: |
Consists of a database called, "DataSource" |
|
|
and a form also called "DataSource". |
|
|
|
|
|
|
Table fields: |
|
|
An |
The table is keyed on this AutoNumber field. |
|
|
Model_Id |
Identifier |
|
|
DateX |
System date |
|
|
TimeX |
System time |
|
|
NameX |
Position identifier, e.g., procedure name |
|
|
NotesX |
Notes |
|
|
Elapsed |
Calculated - time elapsed since previous entry |
|
|
|
|
|
|
The form opens when the database is loaded. |
|
|
It contains a calculated field that shows the elapsed |
|
|
time between the current and previous activities |
|
|
|
|