Results 1 to 5 of 5
  1. #1
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97

    Allow change to a field on new record only

    Hello, I want my user to be able to enter a job number manually, but I don't want them to be able to change it once it's done... I had this code



    Code:
     
    If Me.NewRecord = True Then
    Txt_No.Enabled = True
    Else
    
    Txt_No.Enabled = False
    End If
    but access give me an error 2164
    any idea ?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    What exactly is a 2164 error? What event is the code in?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    Ok error 2164 is I can't put enabled = false cause i'm focused on this field already , I just found out why it didn't work... BUT I have another problem... Enabled=false don't allow me do to anything else since access can't ACCESS (budumpishhhh) to the field if it's enabled = false... I want some code like allowchange=false

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Not sure what you mean. Setting enabled to false will prevent the user from accessing it. You should still be able to get to the value via code, even to change it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Grooz13 is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    97
    well enabled didn't fix my problems it wasn't working , but I used .locked instead and now it works

    thx !

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Field Name Change
    By MelindaP in forum Forms
    Replies: 8
    Last Post: 07-01-2010, 12:03 PM
  2. Replies: 3
    Last Post: 02-19-2010, 04:19 PM
  3. Replies: 9
    Last Post: 11-26-2009, 05:03 PM
  4. Change the value of a field
    By akhilash in forum Queries
    Replies: 0
    Last Post: 07-16-2009, 07:20 AM
  5. Replies: 4
    Last Post: 05-12-2009, 01:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums