Protecting fields??

de049

Registered User.
Local time
Today, 08:56
Joined
Sep 24, 2001
Messages
18
Hi,

How can I set read only attribtues to various textboxes, and only permit the data to be "edited" via my forms when a user presses an EDIT button, and then re-protects the textboxes by pressing another button, possiblty SAVE.
 
to protect your textbox set the Locked to 'yes' or the Enabled to 'no'.

Then to re-enable them with the edit button, place the following on the onclick event of the button:

me.textboxname.locked = false ... if you use the lock feature

or

me.textbxname.enabled = true ... if you use the enable feature
 
ok, so how would i set a single button that sets the 'locked' feature to "YES" or "No" depending on what state it is when press. In other words, the same button to set the value to yes and to no. I dont want to have a button to unlock and another to lock. Its populating my form to much as it is.
 
you could use an if statement

if me.fieldname.locked = true then
me.fieldname.locked = false
else
msgbox "fieldname already locked"
end if

you can leave the else part out if you do not wish to get the message box!
 

Users who are viewing this thread

Back
Top Bottom