Make an array of toggle buttons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chuck

    Make an array of toggle buttons

    How can I make an array of command buttons (or toggle buttons) on a form and
    have a text box on the same form display the index of the button clicked? This
    works very well in VB6, but I can't duplicate the action in Access.

    Chuck
  • Allen Browne

    #2
    Re: Make an array of toggle buttons

    Create an option group.
    Put toggle buttons in the group.
    Then examine the Value of the group to see which one is depressed.
    (It will match the OptionValue property of the button in the group.)

    Another alternative might be to use a tab control, with the Style set to
    Buttons.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Chuck" <libbeyc@school link.netwrote in message
    news:qrn4v3pq2h ar7nshkhe11coui vng97aob8@4ax.c om...
    How can I make an array of command buttons (or toggle buttons) on a form
    and
    have a text box on the same form display the index of the button clicked?
    This
    works very well in VB6, but I can't duplicate the action in Access.
    >
    Chuck

    Comment

    • Chuck

      #3
      Re: Make an array of toggle buttons

      On Tue, 1 Apr 2008 23:52:47 +0800, "Allen Browne" <AllenBrowne@Se eSig.Invalid>
      wrote:
      >Create an option group.
      >Put toggle buttons in the group.
      >Then examine the Value of the group to see which one is depressed.
      >(It will match the OptionValue property of the button in the group.)
      >
      >Another alternative might be to use a tab control, with the Style set to
      >Buttons.
      Thanks for your help.

      Option group worked perfectly. I don't know how many times I had tried to make
      an option group before, but each time I had tried to make the toggle buttons be
      an array ( Toggle1(0), Toggle1(1) etc.). I had defined the array in the form
      module, but apparently not correctly, then set Text1 = Index and Text1=
      OptionValue. No luck. I had been to your web site earlier today, but couldn't
      find what I was looking for.

      Chuck

      Comment

      Working...