P
paul
hi,
ive created a form that opens up with all of the fields locked because some
people are only allowed to view data and not edit ect. i have then created
an unlock button (cmd button) which opens a form. This form is reponsible
for validating a password and if the password is valid unlocking the orginal
from to allow read write access, the code worked when i was using a msgbox
but since i have created the form it doesnt work. i think i has something to
do with the me. part of it but am not sure.. code reads:
dim stdocname as string
dim stlinkcriteria as string
dim txtseccheck as txtbox
dim loki as string
stdocname = "frmupdateunitinformation"
if me.txtseccheck = ucase(NZ(Dlookup("password", "tblpassword","passwordid
=1), ""
docmd close
msgbox ("Access Granted")
docmd.opeform stodcname,,, stlinkcriteria
docmd.maximize
me.allowedits = true
me.allowdeletions = true
me.allowadditions = true
else
me.allowedits = false
me.allowdeletions = false
me.allowadditions = false
msgbox ("access denied")
docmd.close
end if
end sub
ive created a form that opens up with all of the fields locked because some
people are only allowed to view data and not edit ect. i have then created
an unlock button (cmd button) which opens a form. This form is reponsible
for validating a password and if the password is valid unlocking the orginal
from to allow read write access, the code worked when i was using a msgbox
but since i have created the form it doesnt work. i think i has something to
do with the me. part of it but am not sure.. code reads:
dim stdocname as string
dim stlinkcriteria as string
dim txtseccheck as txtbox
dim loki as string
stdocname = "frmupdateunitinformation"
if me.txtseccheck = ucase(NZ(Dlookup("password", "tblpassword","passwordid
=1), ""
docmd close
msgbox ("Access Granted")
docmd.opeform stodcname,,, stlinkcriteria
docmd.maximize
me.allowedits = true
me.allowdeletions = true
me.allowadditions = true
else
me.allowedits = false
me.allowdeletions = false
me.allowadditions = false
msgbox ("access denied")
docmd.close
end if
end sub