Pseudo "Read-Only"?

L

Larry

I have a table of "authorized" users that I want to be able to update
data through a specific form. Other users can view the data with this
form, and use the option buttons to use the filters I created, but not
change any of the data in any manner.

I have a function to see if the person is authorized and if not, I am
setting the form's ALLOWEDIT/ADD/DELETE properties to false. But this
stops the users from being able to use the option buttons too, which I
do want to allow.

I am assuming it's the AllowEdit property being set to false that
stops the user from changing the option buttons (even though they are
not tied to any field in the table). Am I going to have cycle through
each control and lock the ones I don't want them user to use (instead
of using the AllowEdit property)?

I don't want to implement full security and thought this was the "quck
and easy" way to go. Any one have any ideas?

Thanks,
Larry
 
S

Scott McDaniel

I have a table of "authorized" users that I want to be able to update
data through a specific form. Other users can view the data with this
form, and use the option buttons to use the filters I created, but not
change any of the data in any manner.

I have a function to see if the person is authorized and if not, I am
setting the form's ALLOWEDIT/ADD/DELETE properties to false. But this
stops the users from being able to use the option buttons too, which I
do want to allow.

If you want to allow some, but not all, controls to be locked, then you'd need to loop through the controls and lock
them as needed. Many people use the Tag property of the control to determine which ones should be locked; for example,
if you add a "L" to the Tag property of all tags which should be locked, you can then do this:

Dim ctl As Control
On Error Resume Next
'/go through and lock the controls
For each ctl in Me.Controls
ctl.Locked = (ctl.Tag = "L")
Next ctl


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
L

Larry

If you want to allow some, but not all, controls to be locked, then you'd need to loop through the controls and lock
them as needed. Many people use the Tag property of the control to determine which ones should be locked; for example,
if you add a "L" to the Tag property of all tags which should be locked, you can then do this:

Dim ctl As Control
On Error Resume Next
'/go through and lock the controls
For each ctl in Me.Controls
ctl.Locked = (ctl.Tag = "L")
Next ctl

Scott McDaniel
scott@takemeout_infotrakker.comwww.infotrakker.com

Yeah, that's what I thought. Luckily I only need to lock textbox and
combobox controls in the detail section, so that's easy.
 
Top