Solved

how to move through recordset in vba

Posted on 2014-10-05
2
141 Views
Last Modified: 2014-10-05
I changed some code to use the getrows method and my array is populated

I am not sure how to traverse the array.

Watch : - : arrTmp :  : Variant/Variant(0 to 4, 0 to 0)

ive historically used
For index = LBound(arrTmp) To UBound(arrTmp)

but the array has four fields now from the recordset of which there was only one row I am not sure how to set the indexing to only traverse the rows and not the fields
0
Comment
Question by:PeterBaileyUk
2 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 40361859
Try using the 2nd dimension of the array for the rows,
For index = LBound(arrTmp, 2) To UBound(arrTmp, 2)

Open in new window


and the 1st for the fields
 
For fldindex = LBound(arrTmp, 1) To UBound(arrTmp, 1)

Open in new window



PS Are you sure it's 4 fields?
0
 

Author Comment

by:PeterBaileyUk
ID: 40361873
yes i took that from the watch so five fields from 0 to 4, the field count wont change
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now