?
Solved

how to move through recordset in vba

Posted on 2014-10-05
2
Medium Priority
?
157 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Norie earned 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

801 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