Topgun
06-20-2002, 10:01 PM
Hi Programmers,
Umm I was reading my VB6 book and I was reading on Arrays. Well I saw something in it and it gave me a small project to do which turned out to be a major problem. It had to do with displaying 6 employee names in 6 text boxes. So this is the code I came up with.......
Dim Employee(5) As String
Dim txtEmployees As String
for txtemployess = txtname(0 to 5)
Employee(0) = "Name Here"
Employee(1) = "Name Here"
Employee(2) = "Name Here"
Employee(3) = "Name Here"
Employee(4) = "Name Here"
Employee(5) = "Name Here"
End Sub
As you can see I stopped here because while working with my loop, see I was makin a loop so I could assign txtName(0 to 5) to the variable txtEmployees, by the way txtName(0 to 5) are all text boxes that is why they are not declared as variables in my code. Well when I was making my Loop and when i put...... for txtemployees = txtname(0 to 5) and pressed enter to make a new line well I got an error message. And I don't understand why. My txtName(0 to 5) is a control array so I know that isn't the problem. What is the problem? Can someone help me?
Umm I was reading my VB6 book and I was reading on Arrays. Well I saw something in it and it gave me a small project to do which turned out to be a major problem. It had to do with displaying 6 employee names in 6 text boxes. So this is the code I came up with.......
Dim Employee(5) As String
Dim txtEmployees As String
for txtemployess = txtname(0 to 5)
Employee(0) = "Name Here"
Employee(1) = "Name Here"
Employee(2) = "Name Here"
Employee(3) = "Name Here"
Employee(4) = "Name Here"
Employee(5) = "Name Here"
End Sub
As you can see I stopped here because while working with my loop, see I was makin a loop so I could assign txtName(0 to 5) to the variable txtEmployees, by the way txtName(0 to 5) are all text boxes that is why they are not declared as variables in my code. Well when I was making my Loop and when i put...... for txtemployees = txtname(0 to 5) and pressed enter to make a new line well I got an error message. And I don't understand why. My txtName(0 to 5) is a control array so I know that isn't the problem. What is the problem? Can someone help me?