If the name of the field is PROTECTED_FIELD then you could do something like this...
Private Sub PROTECTED_FIELD_Exit(Cancel As Integer)
dim pwd as string
if me.PROTECTED_FIELD <> me.PROTECTED_FIELD.old_value then
pwd = InputBox("You must enter a password to change this field value:", "Password"
if pwd <> "Please" then
cancel = true
endif
endif
End Sub
Serves me right for doing it off the top of my head!!! Sorry about that. Glad you figured it out.
BTW If security is a concern you may also want to consider masking the password. I do not believe the InputBox allows you to do this. I have done so by creating a form that contains a single unbound textbox whose input mask is Password. You can then build the appropriate code to return the value entered back to the calling form for validation...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.