Monitoring fields for changes

Prayder

New Member
Joined
Nov 15, 2018
Messages
4
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?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I have an invisible text box on the form, when the form opens it fills with the userID:
Rich (BB 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)

Rich (BB code):
Private Sub Form_AfterUpdate()

if txtOldVal <> txtVal then
  docmd.setwarnings falses
  docmd.OpenQuery "qaAddLog"
endif

End Sub
<strike></strike>

<strike></strike>
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:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top