Results 1 to 5 of 5

Thread: Option Button Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Malaysia
    Posts
    8

    Exclamation Option Button Problem

    Hello,
    I'm having trouble with my option buttons.
    I have four option buttons label opt1, opt2, opt3 and opt4.
    What is the code so that only opt1 and opt2 is right?
    I would like the opt1 and opt2 equals to
    DayAttend = True

    Thanks in advance

  2. #2
    Hyperactive Member Tequila_worm's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    344
    You gatta explain a little more then that, Becuase when you use
    options buttons, if they are all on the same object you can only select one. And explain a little more on exactly what you are trying to do what is right?? what do you mean by that?

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    Malaysia
    Posts
    8
    hi,
    what i mean is that there's four option button and the user can only choose one at a time. But i want it to be so that of all of the option that's available, only two of them is acceptable.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    You have 4 options buttons, but only two are available for selection??

    Is this the goal?

    If so, what purpose do the other two option buttons serve?

    Or, do you have 4 options buttons, but you want them grouped into twos, i.e., between option1 and option2, you can chose one, and between option 3 and option 4 you can chose one? Is this it?

  5. #5
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Here you go:
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim DayAttend As Boolean
    3.    
    4.     If Opt1 = True Or Opt2 = True Then DayAttend = True
    5.    
    6.     MsgBox DayAttend 'To check the result
    7.    
    8. End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width