Huge array makes VBA execute slowly
I have some VBA code running in a macro which populates an array with rows from a text file. The array resizes dynamically using 'redim'.
The code runs fine until I attempt to load a large text file: c. 300,000 rows. The array itself builds absolutely fine (and surprisingly quickly) but from then on, all VBA code runs painfully slowly. Even stepping over a simple "x=x+1" line takes long enough for me to see "Running." in the title bar of the window.
If I destroy this array, the VBA code runs normally again.
Thank you for taking the time to report an issue.
What's wrong... Please write below.
1. loading all the names from the table into an array starting at array
2. insert "Add New" to array
3. use array to build combo box
Is there any simpler way than this? If the table contains huge number of records, it could e a memory hog
I need to be able to:
1.) Obtain the field names of a query
2.) Place those field names in a string array
3.) Use the string array in looped a function call
I found some good tutorials on the first two, however I cannot find anything on the last. I know it is possible to use variables of a string array in a function call in the C languages, but is it in VBA and if so, how can I do it
Is there a way to run a SQL Query and store the values into an array for further manipulation through VBA? (I don't really want the query output to the screen
Also, how do I get this to happen when the user runs a query
It would be great if I could create new tables in access with headers when writing Excel array to Access. I have Excel and Access 2010!
Each table has about 50,000 lines. So the total would have around 1.2 millions lines, which is not that huge. My Access DB is around 600 megs before the union.
What's the best way to create this master table if union doesn't work? Append maybe?
I want to use the data populated in a table in the subform. I want to pass the value into an Array
Is it possible to pass the 'List of items' in a listbox as an array arugment to an array parameter directly
The following article, while not exploring every facet and option, will demonstrate how to execute SQL using the following methods:
However, I am running into a subscript error because I do not have an idea of the size of the array. If I attempt to reDim my array each time I encounter a value that I want to store, it loses the other values.
Any way to store into a dynamic array without having to run my code twice, the first time to count and the second time to store?