read-only fields

Manic_Rach

Registered User.
Local time
Today, 09:13
Joined
May 23, 2011
Messages
32
hey guys,

I'm creating a form that has fields from multiple tables, however i want the fields from certain tables to be read-only once saved. I think this could have been done with Access 2003 and earlier versions using User-Level Security but I'm using Access 2010. Is there a way of doing this without using User-Level Security?

Thanks,

Rachel
 
hey guys,

I'm creating a form that has fields from multiple tables, however i want the fields from certain tables to be read-only once saved. I think this could have been done with Access 2003 and earlier versions using User-Level Security but I'm using Access 2010. Is there a way of doing this without using User-Level Security?

Thanks,

Rachel

Lock the controls you want locked in the form's On Current event. What I would do is put a value of LOCK in the control's TAG property. Then you can use this simple code in the form's On Current event (you don't even need to change it - just paste it in):
Code:
Dim ctl As Control
 
If Not Me.NewRecord Then
 
   For Each ctl In Me.Controls
      If ctl.Tag = "LOCK" Then
         ctl.Locked = True
      End If
   Next
 
End If
 
That is absolutely fantastic! Thank you so much. Me and my co-workers have been scratching our heads for days trying to find a solution. Thank you!!!!
 

Users who are viewing this thread

Back
Top Bottom