G
Guest
hi ive created a form which opens up with all fields locked. that form has
an unlock button which unlocks all of the fields if the user enters the
correct password. orignally, i had the user entering a password in an
inputbox but realised that this display the password in clear text and not as
*********.
to get round this i was advised to create a form that opens when the unlock
button is pressed (which i did ) then i tried to adapt the code but cant get
it to work, i think it has something to do with the me. statements and a few
others this is the code:
private sub cmdenter_click()
dim stdocname as string
dim stlinkcriteria as string
dim txtseccheck as textbox
dim loki as string
stdocname = "frmupdateunitinformation"
if me.txtseccheck = ucase(NZ(Dlookup("password", "tblpassword ",
"passwordid=1"), ""))
docmd.close
msgbox ("access granted")
docmd.opeformstdocname,,,stlinkcriteria
docmd.maximize
me.allowedits = true
me.allowdeletions = true
me.allow additions = true
else
me.allowedits = false
me.allowdeletions = false
me.allow additions = false
docmd.close
end if
end sub
an unlock button which unlocks all of the fields if the user enters the
correct password. orignally, i had the user entering a password in an
inputbox but realised that this display the password in clear text and not as
*********.
to get round this i was advised to create a form that opens when the unlock
button is pressed (which i did ) then i tried to adapt the code but cant get
it to work, i think it has something to do with the me. statements and a few
others this is the code:
private sub cmdenter_click()
dim stdocname as string
dim stlinkcriteria as string
dim txtseccheck as textbox
dim loki as string
stdocname = "frmupdateunitinformation"
if me.txtseccheck = ucase(NZ(Dlookup("password", "tblpassword ",
"passwordid=1"), ""))
docmd.close
msgbox ("access granted")
docmd.opeformstdocname,,,stlinkcriteria
docmd.maximize
me.allowedits = true
me.allowdeletions = true
me.allow additions = true
else
me.allowedits = false
me.allowdeletions = false
me.allow additions = false
docmd.close
end if
end sub