How to Disable a checkbox in another form while one is selected in another form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msingh24
    New Member
    • Jan 2015
    • 4

    How to Disable a checkbox in another form while one is selected in another form

    I have 2 forms and I want to grey out a checkbox or option button in the 2nd form when one checkbox/optionbutton is selected in this 1st form
    Please HELP!!

    Thanks
  • msingh24
    New Member
    • Jan 2015
    • 4

    #2
    Code:
    Private Sub opt5_AfterUpdate()
        opt5.Enabled = True
            If opt5 = True Then
                opt13.Enabled = False
                    MsgBox "Due to similar course material, you will not be able to select A alongside B"
            If opt5 = False Then
                opt13.Enabled = True
        End If
        End If
    End Sub

    Comment

    • twinnyfo
      Recognized Expert Moderator Specialist
      • Nov 2011
      • 3662

      #3
      You must refer to the Form:

      Code:
      Forms![FormName].Form.opt13.Enabled = False

      Comment

      • msingh24
        New Member
        • Jan 2015
        • 4

        #4
        Thanks for the reply but having tried it,
        it now gives me and error saying Microsoft Access can't find referenced form 'frmModSelect2' - - - Run time error - 2450

        Also that is the name of my form

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3662

          #5
          Are you sure the form is open? Named properly? I know, stupid questions, but we have to ask....

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Is it a subform? If it is, you need to reference it through the parent form.

            Comment

            • msingh24
              New Member
              • Jan 2015
              • 4

              #7
              Thanks guys!! I have got it now

              Comment

              Working...