Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2012
    Posts
    14

    Unanswered: edit and non-editable field in form

    How do I make an empty field editable and for the field with data non-editable in a Form?

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Search in Access help for the Enabled and Locked properties.
    Have a nice day!

  3. #3
    Join Date
    Apr 2012
    Posts
    14
    Quote Originally Posted by Sinndho View Post
    Search in Access help for the Enabled and Locked properties.
    I have tried Lock and AllowEdits in property but then others blank field in the same form cannot be filled in. Specially when users add new record.
    Last edited by mdjet; 06-20-12 at 19:43.

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    For each Control you want to effect, replacing ControlName with your actual name
    Code:
    Private Sub ControlName_GotFocus()
    
    If Nz(Me.ControlName, "") <> "" Then
      ControlName.Locked = True
     Else
      ControlName.Locked = False
     End If
    
    End Sub
    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Apr 2012
    Posts
    14
    wow, this is exactly what I want. I've been scratching my head for this. Thank you very much
    Last edited by mdjet; 06-21-12 at 14:34.

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by mdjet View Post
    wow, this is exactly what I want. I've been scratching my head for this. Thank you very much
    May I ask what Nz means and when to use it?
    if you are developing in Access then you need to develop your skills
    either
    use the inbuilt help system in Access (do a search) or type in NZ in a code window, put the cursor over the nz and press f1
    Or
    consider using google

    also bone up on debugging skills
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •