Monitoring fields for  changes
Results 1 to 2 of 2

Thread: Monitoring fields for changes
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2018
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Monitoring fields for changes

    I have been requested to make changes to an existing database to monitor a field on a form. Access to our forms in our database is based off a windows user id script that runs when the database is opened. Now my boss is wanting to know when someone changes a value within a certain box on a certain form. How would I log each user id that changes the value in that box?

  2. #2
    Board Regular ranman256's Avatar
    Join Date
    Jun 2014
    Location
    Kentucky
    Posts
    1,774
    Post Thanks / Like
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Monitoring fields for changes

    I have an invisible text box on the form, when the form opens it fills with the userID:
    Code:
    sub Form_Load()
     'get user id
    txtUser = Environ("Username")
    
    txtOldVal = me.txtVal
    end sub
    then when the user saves the data , it posts a record to the tLog table (append query)

    Code:
    Private Sub Form_AfterUpdate()
    
    if txtOldVal <> txtVal then
      docmd.setwarnings falses
      docmd.OpenQuery "qaAddLog"
    endif
    
    End Sub



    you can narrow down the save to just 1 field, grab the value when the form opens, then if it changes, run the append query.
    Last edited by ranman256; Feb 11th, 2019 at 02:16 PM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •