Results 1 to 9 of 9
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    528

    value in a text box

    Hi, All


    How the user can not change the value in a text box, but the existence password
    Text box on the form
    No user can (Delete / Edit) what is in the inside of the text
    But show him a message asking him for the password until you change
    Last edited by azhar2006; 02-20-2014 at 03:37 AM.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    I do not understand this question.

  3. #3
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Lock the textbox. Put a button next to it, which needs to be clicked in order to "unlock" the textbox.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    So you want to do this:

    1. Start with the data on your form being locked
    2. If someone wants to change data have a button to unlock the data
    3. If someone clicks that button they must enter a password
    4. If the password is valid the record or field unlocks
    5. When the record is saved the controls lock again

    is this correct?

    I think the only way this is going to work the way you want is if you are doing data entry on an UNBOUND form, otherwise you will be unlocking the controls on ALL records which you probably do not want.

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Yes
    this correct?
    But not every form fields but only one field

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    if you are using a BOUND form this will not function the way you want it to, are you using a BOUND form. A BOUND form means that your form is tied directly to a query or a table and the data you change/add/edit is immediately reflected in the data in the source table.

  7. #7
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much rpeare
    I want the box to be locked when the user goes to a new record, you will need to lock the text box in the form. And only unlock it with the Button or maybe on double clicking the text box ?
    But how ?
    What is the code (VBA) or Function
    Is it possible for example

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    you are not answering the central issue here.

    Are you using a bound form?

    if you are, what you are trying to do will not work


    when you 'unlock' a specific field it will unlock it on ALL records which is not what you want.

    the code to lock/unlock a control is very simple it's just

    fieldname.locked = true
    or
    fieldname.locked = false

    Final warning though, this will not function the way you want on a bound form especially if it's a continuous form.

  9. #9
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Yes rpeare
    I Use a bound form
    Only when the focus
    Or position the mouse pointer inside

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

Similar Threads

  1. Replies: 7
    Last Post: 06-06-2013, 10:32 AM
  2. Replies: 3
    Last Post: 02-07-2013, 09:53 PM
  3. Replies: 1
    Last Post: 06-04-2012, 04:31 PM
  4. Replies: 1
    Last Post: 05-24-2012, 04:59 AM
  5. Replies: 2
    Last Post: 03-01-2012, 12:21 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