You are here: MS Access Products > UI Builder > Product Support > Tracking User Activity

UI BuilderTM for Microsoft® AccessTM

    Tracking User Activity in MS Access

UI Builder's Event Logging capability can help you to capture data about how frequently specific forms or menu commands are used, or simply keep a record of user navigation activity in your database.  For example, if you are making a decision about which forms in your application to retire, you may want to keep a week's record of how often users are actually accessing the form before you remove it.

Example #1 - Tracking All User Navigation Activity

In this example, ever time a user clicks on a menu item, their action will be recorded in the Event Log when the logging level is set to Debug.
  1. Open the module modMenu.
  2. Locate the function fExecuteCommand.
  3. Replace the following line:
Debug.Print "Execute Command " & strMenuCommand & ": " & strCommandDetail

with:
fLogEvent"Execute Command " & strMenuCommand & ": " & strCommandDetail, auiDebug, False, _
            "fExecuteCommand", auiInformation
  1. Locate the function fExecuteSubCommand.
  2. Place the following line:

fLogEvent "Execute Command " & strMenuCommand & ": " & strCommandDetail, auiDebug, False, _
          "fExecuteSubCommand", auiInformation

after these lines:

strMenuCommand = rstSubMenu("SubMenuItem" & iBtn & "a").Value strCommandDetail = _
            rstSubMenu("SubMenuItem" &  iBtn & "d").Value

Example #2 - Tracking Only Specific User Navigation Activity

In this example, only when a user selects a specific menu command will UI Builder log the action.  For example, perhaps you only want to know when users open a report.

  1. Open the module modMenu.
  2. Locate the function fExecuteCommand.
  3. Locate the specific menu command section you want to track.  For example, if you want to track any button activity that opens a subform in read only mode, you would look for the text:  Case "Open Subform (read-only)"
  4. Insert a new line just below with the following VB code:
fLogEvent "Execute Command " & strMenuCommand & ": " & strCommandDetail, auiDebug, False, _
             "fExecuteCommand", auiInformation
  1. Locate the function fExecuteSubCommand
  2. Perform Step 3 above again in this function.