robv19
10-03-2001, 12:20 PM
How would I call the click event in case 0 where mintLenght= 5. And also where would I call it at in my program??
Private Sub optLength_Click(Index As Integer)
'Declare an Integer variable to hold the value of selected option button
Dim mintLength As Integer
Select Case Index
Case 0 'first button is selected
mintLength = 5
Case 1 'second button is selected
mintLength = 15
Case 2
mintLength = 30 'third button is selected
End Select
End Sub
ChiefRedBull
10-03-2001, 12:25 PM
Which Click event do you mean?
<font color=red>Private Sub optLength_Click(Index As Integer) </font color=red>
This one?
If you mean that one - you're already in it in the Case statement.
If you mean a different click event, then change this
<font color=red>Private Sub whatEver_Click()</font color=red>
to this
<font color=red>Public Sub whatEver_Click()</font color=red>
Then use this:
<font color=blue>Case 0 'first button is selected
mintLength = 5
whatEver_Click
Case 1 'second button is selected
mintLength = 15 </font color=blue>
To call it.
Chief
"How are we to learn, if those that know will not teach... ?" - Me.
Laurent
10-03-2001, 12:32 PM
in this sub you initiate a var but you never use it, do you intend to use this var?
I'll be amongst the best any minute now !
KesleyK
10-03-2001, 01:06 PM
And if it is on a separate form, say Form1, remember to explicitly call it out via:
Form1.whatEver_Click
__________
HOOOaaaaa! Semper Fi!
robv19
10-03-2001, 01:10 PM
What is the name of the variable initialize but don't use??? I thought the only variable I have is mintLength? Please help me figure this out. I am not sure I understand. And I do use mintLenght elsewhere in the program
Laurent
10-03-2001, 01:31 PM
well in this sub you declare a var mintLength then you initialyse it to a number end then the sub ends so you will never use this one. if you need to use it elsewhere you should declare it globaly or in a module
I'll be amongst the best any minute now !