Solved

how to move through recordset in vba

Posted on 2014-10-05
2
149 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

828 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