Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2003
    Posts
    64

    Unanswered: entry boxes locked when check box is click.

    I have two entry boxes for users to enter data. When they click the check box I would like the boxes to lock and turn gray. Thus, they cannot go back and edit the information.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    In the On Click event for your CheckBox, copy and paste the following code:

    Me.myTextBox1Name.Enabled = Not Me.myCheckBoxName
    Me.myTextBox2Name.Enabled = Not Me.myCheckBoxName

    As long as your fields are disabled, nothing can be entered.


  3. #3
    Join Date
    Aug 2003
    Posts
    64

    update

    Ok that worked,

    But after the information is entered then the check boxe will be lock the entry boxes. Not permanently every time it’s open. When I open the application where locked out completely.

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    ???????????

  5. #5
    Join Date
    Aug 2003
    Posts
    64
    After I completed entering data into the text boxes I will click a check box saying it's done. After I click the check box it will gray out the entry boxes to prevent editing.

    From your last suggestion I cannot enter anything when I open the application, it's locked.

  6. #6
    Join Date
    Nov 2003
    Posts
    1,487
    Click the CheckBox again.....the TextBoxes will re-enable for data entry. It's a Toggle.


  7. #7
    Join Date
    Aug 2003
    Posts
    64

    Thanks,

    From your first answer it worked had my spelling wrong, sorry for the confusion. It toggles just fine as you mention. However when the data is entered and the check box is click it should lock permanently. I don't want it to toggle.

    How can this be done?

  8. #8
    Join Date
    Nov 2003
    Posts
    1,487
    Insert a Yes/No field into your table. Bind the checkbox located on your Form to this table field. Then in the On Current event of your Form, enter the previous code sample.

    It would then most likely be a good idea to make the user supply a password when attempting to unlock the TextBoxes with the CheckBox.


Posting Permissions

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