Allowing Edits in Selected Form fields/controls

Lissa

Registered User.
Local time
Today, 08:32
Joined
Apr 27, 2007
Messages
114
Is there a way to make some controls on a form read-only and other controls on the same form allow editing? I guess in some way override the Allow Edit property?

If anyone can point me to some examples or has a suggestion on how to go about doing this - I'd appreciate it!

Thanks!
Lissa
 
as boB larson told me and many others. try using the tag property of the fields and for the tags with a certain tag property then allow else dont allow
so it would be in the onload of the form

if tag=something
allow edit
else
dont allow
end if
 
Use the Locked property
 
So, as Ray has mentioned you could do this:

If you want to enable or disable the controls easily via code, you should put something into the TAG property of the controls you want to affect. Something like lock would be acceptable. Then you can use this:

Code:
Dim ctl As Control
  For Each ctl In Me.Controls
     If ctl.Tag = "lock" Then
        ctl.Locked = True
     End If
  Next ctl

Then use the same code to unlock by putting it in a different event and change True to False.
 
Oooohhh okay I think I understand how to go about it - I'll try it.

Thanks Bob & Ray!
 

Users who are viewing this thread

Back
Top Bottom