Results 1 to 6 of 6
  1. #1
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Enable / Disable or Locked Text Boxes

    I am trying to write a code on a subform "SalesSubform"
    If TextBox "Loc" = Null Then TextBox "Text56" and TextBox "Text86" and TextBox "Text530" are locked or disabled/locked
    and If TextBox "Loc" is not null then the TextBoxes "Text56" "Text86" "Text530" are enabled.

    how can I write this code, I will put this code in ON CURRENT Properties of "SalesSubform"

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If you want this to be dynamic per record on continuous or datasheet form, must use Conditional Formatting. Recommend CF even if single view form.

    If you use VBA, will likely need code in Current event as well as textbox Loc AfterUpdate.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Can you guide where can I read about this

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    About what - Conditional Formatting?

    Search web. Common topic.

    Any introductory book on Access should have guidance.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    conditional formatting is not the solution
    as on the form if loc value is null then it should lock or disable the textboxes "Text56" "Text86" "Text530 so no data input unless a value in loc is entered.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why not?

    A CF rule could be an expression. If expression is true then control will be disabled. As soon as value is entered, textbox will enable. If entered Loc value is removed then textbox will disable again.

    [Loc] Is Null
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. The Locked Property isn't Locking my text boxes...
    By HillChris7714 in forum Forms
    Replies: 3
    Last Post: 10-12-2016, 09:48 AM
  2. Enable disable function not working
    By jj1 in forum Access
    Replies: 5
    Last Post: 02-26-2015, 12:09 PM
  3. Enable/Disable Button
    By P.Malius in forum Programming
    Replies: 3
    Last Post: 09-07-2012, 08:36 AM
  4. Function to Enable/Disable Field
    By swalsh84 in forum Programming
    Replies: 5
    Last Post: 11-04-2010, 02:48 PM
  5. Replies: 3
    Last Post: 09-29-2010, 09:31 AM

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