1903raj
May 16, 2012, 02:00 PM
Hi,
In my program, I have two forms the first form has a text box and a button and the second form has 5 textbox.
What I am trying to do is if the user input 1 the form 2 should show one text box . If use user input is 2 then show 2 textbox in form and if input is 3 then form 2 should have 3 textbox.
The code which I have written is
Public Sub Command1_Click()
Dim I As Integer
If (Val(Text1) >= 1 And Val(Text1) < 3) Then
For I = 0 To (Val(Text1.Text) - 1)
Print I
Form2.Text1(I).Visible = True
Next
Form2.Show
End If
End Sub
In my program, I have two forms the first form has a text box and a button and the second form has 5 textbox.
What I am trying to do is if the user input 1 the form 2 should show one text box . If use user input is 2 then show 2 textbox in form and if input is 3 then form 2 should have 3 textbox.
The code which I have written is
Public Sub Command1_Click()
Dim I As Integer
If (Val(Text1) >= 1 And Val(Text1) < 3) Then
For I = 0 To (Val(Text1.Text) - 1)
Print I
Form2.Text1(I).Visible = True
Next
Form2.Show
End If
End Sub