Results 1 to 6 of 6
  1. #1
    NOTLguy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    60

    Disabling a control

    On my form, I wish to disable one or two of three controls that follow the control I am in, depending on the selection made. The control I am in with the selection drop down is a is a lookup field from another table. This would prevent data entry in some of following three controls depending on choice from the first control. Is that possible?

    Thank you,
    Bill

  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,521
    This type of thing, using the Enabled property instead of the Visible property:

    http://www.baldyweb.com/ConditionalVisibility.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    NOTLguy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    60
    Quote Originally Posted by pbaldy View Post
    This type of thing, using the Enabled property instead of the Visible property:

    http://www.baldyweb.com/ConditionalVisibility.htm
    I tried to enter this code:

    Private Sub CodeId_AfterUpdate()
    If Hours.HoursId = 1 Then
    Hours.Unreg.Enabled = False
    End If
    End Sub

    in the Event Procedure for After Update and it bombed.

    Error 424 Object Required.

    The Control on the form I entered the code in is a lookup field in the Hours Table gathering data from another table ( Codes ) where the fields in the Lookup Query are in order of selection:

    Codes.CodeId
    Codes.CodeType
    Codes.CodeDescription

    presenting a pick list for the user.

    Bill

  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,521
    Here's the proper syntax to refer to controls:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    NOTLguy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    60
    Quote Originally Posted by pbaldy View Post
    Here's the proper syntax to refer to controls:

    Forms Refer to Form and Subform properties and controls
    Once I gor the syntax correct, all was well.

    Thank you,
    Bill

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help Bill.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Disabling textbox on reloading the form
    By accesscoder in forum Forms
    Replies: 3
    Last Post: 10-16-2010, 05:55 PM
  2. Disabling A Button
    By cksm4 in forum Programming
    Replies: 8
    Last Post: 10-05-2010, 02:07 PM
  3. Disabling Design View
    By DonnyArt in forum Access
    Replies: 1
    Last Post: 06-29-2010, 08:08 AM
  4. Disabling Text Box for Certain Users
    By sky in forum Forms
    Replies: 1
    Last Post: 12-31-2009, 09:06 PM
  5. Replies: 0
    Last Post: 10-12-2009, 08:26 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