Form Security

M

Michaelcip

Thanks in advance.
I'm using 2003, I've set up security, I want to prevent a specific user from
being able to modify specific fields in a form that opens up in datasheet
view. I've attempted the following behind the form & it's not working:

Private Sub Form_Load()
If CurrentUser() = "blackman" Then
Me.ID = vbReadOnly
Me.GageNo = vbReadOnly
Me.EmpNo = vbReadOnly
Me.GageOwner = vbReadOnly
Me.QA = vbReadOnly
Me.QARecDate = vbReadOnly
Me.QARetDate = vbReadOnly
Me.EmpNoRecd = vbReadOnly
Me.CalCategory = vbReadOnly
End If
End Sub

Many thanks again, MC
 
J

John W. Vinson

I'm using 2003, I've set up security, I want to prevent a specific user from
being able to modify specific fields in a form that opens up in datasheet
view. I've attempted the following behind the form & it's not working:

If you're using Workgroup Security (which unfortunately limits you to the .mdb
format in A2007 and later versions, since the security features are not
available in the newer .accdb format), why not just set that user's
premissions to read only on that table, query, or form? You're using security
already - you don't need VBA code to tweak form properties to have it take
effect!
 
M

Michaelcip

Thanks John. I had figured it out. Interesting though,...I didn't get a
notification of your reply. Need to check into it. Have a great weekend. MC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top