-
October 30th, 2000, 08:12 AM
#1
How to work with array of labels?
I'm having problems with the following code:
Private Sub Form_Load()
Dim test(5) As Label
Dim a As Integer
Grid.Col = 0
For a = 1 To 10
test(a).LinkTopic = "REUTER|IDN"
test(a).LinkItem = "SE0" & a & "01T=,BID"
test(a).LinkMode = 1
Grid.Row = a
Grid.Text = test(a).Caption
Grid.Rows = a + 1
Next a
End Sub
I get error message 91: "object variable or with block variable not set". What the hell is wrong?
-
October 30th, 2000, 08:14 AM
#2
Re: How to work with array of labels?
you didn't tell us the line where the error occurred, so I am only guessing.
You need to Load the elements of your control array:
Grid.Col = 0
For a = 1 To 10
Load test(a)
test(a).LinkTopic = "REUTER|IDN"
test(a).LinkItem = "SE0" & a & "01T=,BID"
-
October 30th, 2000, 09:02 AM
#3
Re: How to work with array of labels?
I forgot to mention where the error occurred. It is on the line:
'test(a).LinkTopic = "REUTER|IDN"'
I tried to Load Test(a), but it still did not work.
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
|