R
Richard Hollenbeck
Inside a private sub, I want to query another table for list of valid record
numbers. I want the results in an array. But I'll never know from one time
to the next how big to make the array. It's too bad I couldn't just make it
open ended, or can I? I currently have only about 50 records. So if I make
it something like:
Dim recordNum(1 to 1000)
it will work for a few months before I need to change it to a bigger number.
Isn't there a way to dynamically resize the array? Or set the size of the
array based on how many records I will find?
Do I first need to query the table to count the records?
dim numOfRecords as integer
numOfRecords=1
'then insert the results of a count query into
'numOfRecords and use that variable as the
'size of the array.
Dim recordNum(1 to numOfRecords)
Then I could insert the record numbers into this array to use later. Would
something like that work or is there a much simpler approach? Ideas? Many
thanks.
Rich Hollenbeck
numbers. I want the results in an array. But I'll never know from one time
to the next how big to make the array. It's too bad I couldn't just make it
open ended, or can I? I currently have only about 50 records. So if I make
it something like:
Dim recordNum(1 to 1000)
it will work for a few months before I need to change it to a bigger number.
Isn't there a way to dynamically resize the array? Or set the size of the
array based on how many records I will find?
Do I first need to query the table to count the records?
dim numOfRecords as integer
numOfRecords=1
'then insert the results of a count query into
'numOfRecords and use that variable as the
'size of the array.
Dim recordNum(1 to numOfRecords)
Then I could insert the record numbers into this array to use later. Would
something like that work or is there a much simpler approach? Ideas? Many
thanks.
Rich Hollenbeck