Lock TextBox if another TextBox's value is "" or Null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Minion
    Recognized Expert New Member
    • Dec 2007
    • 108

    #16
    Just thought of something when I was reading over the thread again. If you're looking to use the check to activate another control you may wish to use .Enabled instead. This will still show the control on the form so the user will know there is one, but will gray it out until the first control code is activated. So your code would look like.

    [code=vb]
    Private Sub POL_Actions_Aft er_Update()
    If IsNull(Me!Chang e_Withdrawn) Then
    Me!Reason_for_W ithdrawal.Enabl ed = False
    Else
    Me!Reason_for_W ithdrawal.Enabl ed = True
    End If
    End Sub
    [/code]

    Just a thought.

    - Minion -

    Comment

    • jambonjamasb
      New Member
      • Jan 2008
      • 41

      #17
      Originally posted by Minion
      Just thought of something ...........

      [code=vb]
      Private Sub POL_Actions_Aft er_Update()
      If IsNull(Me!Chang e_Withdrawn) Then
      Me!Reason_for_W ithdrawal.Enabl ed = False
      Else
      Me!Reason_for_W ithdrawal.Enabl ed = True
      End If
      End Sub
      [/code]

      Just a thought.

      - Minion -
      Hi Min,

      I highlighted Change_Withdraw n
      Selected after event and entered into the code builder
      Private Sub Change_Withdraw n_AfterUpdate()
      If IsNull(Me!Chang e_Withdrawn) Then
      Me!Reason_for_W ithdrawal.Enabl ed = False
      Else
      Me!Reason_for_W ithdrawal.Enabl ed = True
      End If
      End Sub

      I also tried to replace enabled with visable, both returned error code 438. I read through the help in access and didn't really understand it. Is this due to how I created the private sub or how I named it?

      Comment

      • jambonjamasb
        New Member
        • Jan 2008
        • 41

        #18
        Thanks for all your help with this sorry to be such a pain.

        Comment

        • jambonjamasb
          New Member
          • Jan 2008
          • 41

          #19
          I have also been on the microsoft website and again it was talking about binary updates as you are aware I only have a basic knowledge of access, but thanks to you guys it is growing.

          Comment

          Working...