Re: Locked property

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 07/20/04


Date: Wed, 21 Jul 2004 00:50:15 +0800

Which line causes the error?

Is it possible that the Name of your control is not the same as the name of
the Field? If so, the field does not have a Locked property, which makes
sense of the error message.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"shaggles" <anonymous@discussions.microsoft.com> wrote in message
news:0ac301c46e77$a50617a0$a501280a@phx.gbl...
> I keep getting the same error message no matter what I
> try.  UserID is a text field.  Response is a memo field
> and Sign_Off is a boolean field.
> >-----Original Message-----
> >UserID is a Text type field?
> >CurrentUser() is a function, so try adding the brackets.
> >
> >This example sets a flag to lock the text boxes if the
> UserID in the form is
> >not the same as CurrentUser(). It also locks the fields
> if there is not
> >UserID (e.g. at a new record).
> >
> >Private Sub Form_Current()
> >    Dim bLock As Boolean
> >    bLock = Not Nz(Me!UserID = CurrentUser(), False)
> >    Me!Response.Locked = bLock
> >    Me!Sign_Off.Locked = bLock
> >End Sub
> >
> >
> >
> >"shaggles" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:00c601c46dc9$409ad700$a501280a@phx.gbl...
> >> I am trying to set the Locked property of a comment
> field
> >> based on the user id.  I got the following code from vb
> >> help in access but I get an error message saying the
> >> object doesn't support this property or method.  The
> field
> >> I'm trying to lock are on a subform.  Does that make a
> >> difference?  I put the code in the On Curent event of
> the
> >> subform.
> >> Private Sub Form_Current()
> >> If Me!UserID = CurrentUser Then
> >> Me!Response.Locked = False
> >> Me!Sign_Off.Locked = False
> >> Else
> >> Me!Response.Locked = True
> >> Me!Sign_Off.Locked = True
> >> End If
> >> End Sub
> >
> >
> >.
> >


Relevant Pages

  • Re: Locked property
    ... UserID is a Text type field? ... CurrentUser() is a function, ... The field> I'm trying to lock are on a subform. ... > Private Sub Form_Current ...
    (microsoft.public.access.modulesdaovba)
  • Re: multiple criteria in dlookup
    ... if, for some reason, a userid isn't found the default will be to set their ... if the dlookup fails it will aloow the user to Edit. ... Private Sub Form_Open ... the form, error message says " Run-time error 13, type mismatch" and it ...
    (microsoft.public.access.forms)
  • Re: multiple criteria in dlookup
    ... the form, error message says " Run-time error 13, type mismatch" and it ... Private Sub Form_Open ... The DLookUp will be the UserID if it exists, ...
    (microsoft.public.access.forms)
  • Re: Cant Find The Macro "me"
    ... Is [UserID] a numeric field? ... Private Sub Combo50_AfterUpdate ... "Charles Phillips" wrote: ...
    (microsoft.public.access.forms)
  • RE: On Form Error: MsgBox
    ... just the form) I want it to prompt the first prompt in the code below then ... Can you help me modify the below code to prevent the above error message from ... Private Sub Form_Error(DataErr As Integer, Response As Integer) ...
    (microsoft.public.access.formscoding)

Loading