using keypress with option group...out of range

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

    using keypress with option group...out of range

    I was using the keypress with an option group

    If Me.ActiveContro l.ControlType = acOptionGroup Then
    If KeyAscii >= 48 And KeyAscii <= 51 Then
    Me.ActiveContro l.Value = Chr(KeyAscii)
    End If
    End If

    well this works fine if all the option groups have the same buttons

    but if one has 9 buttons you would have to do something like
    keyascii>=48 and keyascii<=57

    so then I ran into a page full of different amounts of buttons.

    anywhere from 2 to 9 buttons and if I just did this I would end up
    putting 9 in values that only took 2 or 3.

    I do not want to go thru and put in range checks because not only
    would this be a lot of work but would cause error boxes for values out
    of range instead of just ignoring out of range values.

    Is there a way to look at the value of the buttons in the option group
    and use that value to determine min and max of the control so I could
    automate each controls min and max values on its buttons ?



Working...