-
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" on the line reading 'test(a).LinkTopic = "REUTER|IDN"'. I have tried to load test, but it does not work either. What the hell is wrong?
-
The labels you declared there are an array of labels, not a controlarray with labels. It would work if you only set the labels a reference to your labels you have on the form. Another thing you could do is to use the control array directly