From: Michaelcip on
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
From: John W. Vinson on
On Wed, 24 Mar 2010 15:00:06 -0700, Michaelcip
<Michaelcip(a)discussions.microsoft.com> wrote:

>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!
--

John W. Vinson [MVP]
From: Michaelcip on
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

"John W. Vinson" wrote:

> On Wed, 24 Mar 2010 15:00:06 -0700, Michaelcip
> <Michaelcip(a)discussions.microsoft.com> wrote:
>
> >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!
> --
>
> John W. Vinson [MVP]
> .
>