passwords

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.
..
 
M

mafra

Hi,
you can do this by programming it in VBA by yourself.I
don't know a "simpler" way.
 
J

Jim/Chris

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
 
T

TC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top