Help to clear a combo box when a option button is selected.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ducky
    New Member
    • Oct 2006
    • 19

    Help to clear a combo box when a option button is selected.

    I have set up two option buttons. When option button 1 is selected I need to make sure that the combo box located beside Option button 2 is cleared. In turn I need to make sure that if a value is selected from the combo box that option button 2 is selected.
    Help me please!!
  • cyberdwarf
    Recognized Expert New Member
    • Nov 2006
    • 218

    #2
    Hi ducky

    First, a question..

    Are your option buttons inside an option box?

    Steve

    Comment

    • ducky
      New Member
      • Oct 2006
      • 19

      #3
      Originally posted by cyberdwarf
      Hi ducky

      First, a question..

      Are your option buttons inside an option box?

      Steve
      Yes they are in an option box.

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by ducky
        I have set up two option buttons. When option button 1 is selected I need to make sure that the combo box located beside Option button 2 is cleared. In turn I need to make sure that if a value is selected from the combo box that option button 2 is selected.
        Help me please!!
        Assuming Option frame name as opt_frame1 and combobox name as combo0.

        You will need an event on the option frame, so for this example I'm using the after update event.

        Code:
           
        Private Sub opt_frame1_AfterUpdate()
         
          Select Case opt_frame1
         
        	Case 1 ' if 1 is selected
        	  Me.Combo0 = Null 
         
        	Case 2 'if 2 is selected
        	  ' whatever you want to do here
         
          End Select
         
        End Sub
        You will need an event on the combobox, so for this example I'm also using the after update event.

        Code:
           
        Private Sub Combo0_AfterUpdate()
         
          Me.opt_frame1 = 2
         
        End Sub

        Comment

        • ducky
          New Member
          • Oct 2006
          • 19

          #5
          Thank you very much!! It worked.. :)

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Originally posted by ducky
            Thank you very much!! It worked.. :)
            You're welcome.

            Comment

            • Hutch
              New Member
              • Mar 2007
              • 74

              #7
              So i'm trying to use this coding but its not working. here is what i'm attempting...

              i have a form based on a query i'm using to search previous records, i have two combo boxes i use to search data, after i run a update procedure of one combo box the information is displayed in text boxes. I use combo box "A" to search the records by name, and combo box "B" to search by number. i need each combo box to appear null after the update procedure runs. any thoughts?

              Comment

              Working...