so perhaps someone can tell me if what i want to do is possible.

i have a bunch of radio buttons which can have different text displayed depending on whats retrieved from the database.

however i want to add code that hides any radio button that would have a 'zero' retrieved from the database.
so far this is the code i was coming up with, without getting into the nitty gritty of the actual database queries

If RadioButton1.Text = Me.HWExamsDataSet.DSExamTextA.Rows.Item.tostring = 0 Then
            RadioButton1.Visible = False
        End Ifabase entries or queries.

it looks like it may work...but is there a way to automate it so that i can put in a reference to ANY radiobutton like radiobutton(*).text? or a bunch of buttons if need be.

i know theres a way to specify additional items to a given command...just can't remember if its curly brakets etc.

make an array of all radio button then simply run a loop that's it!

You could also put all of the radio buttons inside a container like a GroupBox and access them all by

Imports System.Windows.Forms
.
.
.
For Each ctrl as Control In GroupBox1.Controls
    Debug.WriteLine(ctrl.Name)
Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.