Quote:
>I dimension an array using Dim in the general declarations section of a form
>so it can be used throughout the form. Then I want to ReDim it in a Sub
>within the form, but it won't let me. Any ideas?
I had the same problem but with the help of the net i have here the
solution:
in a module i have made a userdefined type:
Type Test
x as Integer
y as String
End Type
in the general Declarations section i have initialized the array:
'just according to the help-files and examples
Dim TestArray() As Test
'and a variable i need later
Dim Counter
So now i have an array of zero and i can use ReDim to change the size.
In the Form_load event i set the Counter to zero:
Counter=0
In a procedure i have to change the size, i coded like this:
Sub Command1_click()
Counter=Counter+1
ReDim Preserve TestArray(Counter)
TestArray(Counter).x=1
TestArray(Counter.y="a"
end Sub
gr. walther
------------------- cut here ---------------
Walther Musch
Tilburg University Holland