Solved

how to move through recordset in vba

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hit enter key to run macro 13 24
Access 2016 7 35
Microsoft Access - Stopping Control - (minus) 4 32
Access datasheet - showing a number in scientific notation 4 23
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

832 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