RadioButton listing True

pryspr01

Member
Joined
Jan 5, 2006
Messages
15
Programming Experience
Beginner
Hi, im trying to get my radiobox to say Yes if checked, No if not checked in the database. I'm getting an error saying it is not accessible because it is 'Private". It has an issue with "Active", which is a field in my database. As if right now its just changing the Yes/No to True, because I have those 2 buttons bound right now. Any suggestions?

VB.NET:
    Private Sub rbActiveStatusYes_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbActiveStatusYes.CheckedChanged
        Dim intposition As Integer
        Dim objcommand As SqlCommand = New SqlCommand

        intposition = objcurrencyManager.Position

        objcommand.Connection = objconnection
        objcommand.CommandText = "SELECT Active FROM ProspectTable"

        objconnection.Open()

        If (Active) = True Then
            rbActiveStatusYes.Checked = True
        Else
            rbActiveStatusYes.Checked = False
        End If

        objconnection.Close()

        FillDataSetandView()
        BindFields()

        objcurrencyManager.Position = intposition

        Showposition()


    End Sub
 
VB.NET:
        If RadioButton1.Checked = True Then
            RadioButton1.Text = "Yes"
            RadioButton1.ForeColor = System.Drawing.Color.Green
        Else
            RadioButton1.Text = "No"
            RadioButton1.ForeColor = System.Drawing.Color.Red
        End If
 
Back
Top