Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optionbuttons with a index which has to be controled!!

Status
Not open for further replies.

DaTommyboY

Programmer
Feb 10, 2004
40
NL
Hello Everybody,
I am looking for a way to control some optionbuttons with a index number, like Option1(0), Option1(1) and Option2(0) ans so on.

Without the index number it works quit nice like the code displayed here,
does anybody know a way to do that?

Code:
Dim K as Integer
K=1
Form1.Controls("Option" & Trim(Str(K))).Visible = True

Thanks in advance

Tom
 
Hi Tom:

Is there anything wrong with
Code:
    Dim K As Integer
    K = 1
    Form.Option(K).Visible = True
?

Cassandra
 
Hi Cassandra,
I realy don't konw whats wrong with that ;-)
It your solution works it wil save some typing, but it does not solve my problem!!!
You refere to option1, but i like to refere to option1(0) and option1(1) and so on.

But i wil try to get it to work with your way, however feel free to puch me in the right direction.

Tom
 
This uses only two options buttons this is the way I use them. When you set them up of course you use the same name.

If Option1(0) = True Then 'Option button 1 array
Paid = txtCurrentYear(1)
yearPaid = txtCurrentYear(0)
End If
If Option1(1) = True Then 'option button 2 array.
Paid = txtCurrentYear(3)
yearPaid = txtCurrentYear(2)
End If

If Option1(0) = True Or Option1(1) = True Then
txtDatePaid.SetFocus
paidClicked = True
End If

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top