Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Varying Length Dynamically

Question:
I know VB insists on a _constant_ for the array subscript. Has anyone found a way around this? I would like to set an array length equal to the number of records in an Access 2.0 table.

Answer:
The best way to do this is to first Dim the array as one record, for instance. Then, when you have the RecordCount from the database, use the ReDim Preserve command to expand the array to fit the record set.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date