Results 1 to 3 of 3

Thread: Option Buttons

  1. #1
    Join Date
    Oct 2003
    Posts
    11

    Talking Unanswered: Option Buttons

    How can i set an optoin button to true(i.e. pressed in in VBA. I know this is a simple question but i can not get it to work.

    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Cambridge, England
    Posts
    47
    MyForm!MyOptionButton.Value = TRUE

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    In most cases, there are usually more than one option button to choose from. As to say for example, there are three options and you will select one of the three. Again, usually, these option buttons are placed into a Frame control so as to reduce the over head required to determine which option is selected. If this is the case, then to set any one option button within the frame group to true, you would use the following code:

    Me.Frame1.Value = 2

    Where:
    Frame1 is the Frame control that has grouped three option buttons.
    2 is the Index number of the option button within the Frame group. In this case, the second option button.

    The code line above sets the second Option button to TRUE and all others to false.
    The code line below sets the third Option button to TRUE and all others to false.

    Me.Frame1.Value = 3

    and so on......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •