Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays in VBA

Status
Not open for further replies.

mje397

Programmer
Nov 3, 2004
17
US
Can I use arrays to specify elements fo a column in VBA
say for eg.,

Dim Counter As Integer


Counter=1

and can I use

rst!Store(Counter)

to indicate the first value in my Store Column?

Is there any other way to do this?

 
you don't have anything in this thread that is an array.

Code:
Dim arrOne(0 to 9) as integer 'is a one dimensional array and contains 10 entries.
Dim arrTwo(0 to 9,0 to 9) as integer ' is two dimensional with 100 entries.
Dim arrThree(9,9,9) as integer 'is three dimensional with 1000 entries.

now, this creates an array. You can also have an array of strings:

Code:
Dim strArray(0 to 9) as string

What are you trying to do?

Leslie
 
Sorry for the misunderstanding!!
I am trying to traverse through my column values by using an index. Say for ex. I have a column called demand having demand at various periods( say 100)..

Can I index each demand with the period using a counter in a loop?

 
If rst is a Recordset (either DAO or ADODB), take a look at the GetRows method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Trendy people use collections in this situation.

 
Really trendy people use Dictionaries if the data has more than one dimension of complexity. :)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top