Results 1 to 2 of 2

Thread: Option buttons

  1. #1
    Join Date
    Oct 2009

    Unanswered: Option buttons

    I'm having a problem coding a button that uses option buttons as criteria. The first option button is called ReportToggle, and the second is called GraphToggle. For some reason I can't pull up the value in ciode....This is what I have so far....

    Private Sub Command145_Click()
    If Me.ReportToggle.Value = True Then
    GoTo IsReport
    GoTo IsGraph
    End If
    If Me.GraphToggle.Value = True Then
    GoTo RunGraph
    GoTo NoneSelected
    End If
    MsgBox ("Please Select Report Type: Report or Graph!"), vbOKOnly, "Report Error"
    Exit Sub
    MsgBox ("This is a report.")
    Exit Sub
    MsgBox ("This is a graph.")
    Exit Sub
    End Sub
    Does anyone know what I did wrong?

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    If the option buttons are included in an option group you cannot do that. In this case, every option button has a value (1,2,3, etc.) and you have to test the value of the option group itself to know which option button is "on". The value of the option group will change and take the value of the option button you click on.
    Have a nice day!

Posting Permissions

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