Solved

how to move through recordset in vba

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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…

705 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