passwords

  • Thread starter Thread starter Ted D.
  • Start date Start date
T

Ted D.

Is there a way to password protect a check box or text
box? The box would not let you check it or enter info
until the password has been entered. also is there a way
to hide data after it has
been entered?
Thanks
Ted D.
..
 
You could try something like this in the before Update
Event of the field

dim strPW as string
strPW = inputbox("Please enter password to change this
field","Enter Password")

if strPW = "password" then
Me.FieldName.Locked = False
else
Me.FieldName.Locked = True
msgbox "The password did not match, please try again."
end if

Jim
 
Close: but no banana! BeforeUpdate is way too late to change the Locked
property of that control.

Try this code in the BeforeUpdate event of the checkbox:

(untested)

if inputbox ("enter password") <> "s3cr3t" then
me.undo
cancel = true
endif

If you get tired of repeatedly entering the password, try this:

static bOK as boolean
if not bOK then
if inputbox ("enter password") = "s3cr3t" then
bOK = true
else
me.undo
cancel = true
endif

HTH,
TC
 
Back
Top