Results 1 to 2 of 2

Thread: Option Buttons

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    Ok My Problem Is I Have 4 Option Buttons And 1 command button but I want it to ignore what the command button does normally when one of the option buttons is selected how do i do that?

    I can get it so it does the option i select as well as what is already in the command button but it won't ignore what's already in the command button can someone give me a full example how to do this?

  2. #2
    Member
    Join Date
    Jan 1999
    Location
    London, UK
    Posts
    58

    Post

    If my understanding of your problem is that when one of your 4 option buttons is selected you do one thing and if nothing is selected you do something else, here's a quick snippet...

    Private Sub Command1_Click()

    Dim iCount As Integer, bSelect As Boolean

    ' this assumes your option buttons are a control array called "Option1"

    For iCount = 0 to 3
    If Option1(iCount).Value Then
    bSelect = True
    Exit For
    End If
    Next

    If bSelect = True Then
    ' add your code for when an option is selected
    Else
    ' add code for when no option is selected
    End If

    End Sub

    ------------------
    * * * * * * * * * * * * * * * * * * * * * *
    * *
    * AndyC *
    * London *
    * email: andy.collyer@bigfoot.com *
    * *
    * * * * * * * * * * * * * * * * * * * * * *

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