|
-
Mar 8th, 2000, 10:58 PM
#1
Thread Starter
Hyperactive Member
Hi!,
On my form I have text1(0). When the user clicks a command button, another textbox is loaded below it. The code I use for this is:
Private Sub Command1_Click()
Static Index As Integer
Index = Index + 1
Load Text1(Index)
Text1(Index).Visible = True
Text1(Index).Move Text1(Index - 1).Left, Text1(Index - 1).Top + Text1(Index - 1).Height
End Sub
The user can create as many text boxes as they want.
Now my problem is when the user clicks on a 'Showform2' button. I also have a textbox array, text2(0), on form2. I want the same number of textboxes to load on form2 as are on form1, and the contents of the textboxes on form2 to be the same as those on form1.
The code I use at present, on the form2_load() event, is:
Private Sub Form_Load()
For Index = 0 To Form1.Text1().Count - 1
Text2(Index)= Form1.Text1(Index)
Next Index
End Sub
But this gives me an error: 'Control array element '1' doesn't exist'. if I create more than 1 textbox on form1.
How can I load the same number of boxes on form2 as form1?
Thanks for any help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|