LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default loop problem


Hi

i am using this loop to retrieve data from a recordset. The problem is
that when the while loop ends, it goes to the next (line 10) which is
fine, but then it goes to line 3 and not to line 2 where it was
supposed to go to the next c (the next field in the recordset). I have
already tried to put the next just after the for, and it worked fine
(but in this case its only possible to get the fields names or values,
but not all records). i have also tried to replace the while fo another
for... next but it didnīt worked also.

Any clues?

1 With rstRecordset
2 For Each c In .Fields
3 b = b + 1
4 While Not .EOF
5 ThisWorkbook.Sheets("entradas").Select
6 Cells(a, b).Value = c.Value
7 a = a + 1
8 rstRecordset.MoveNext
9 Wend
10 Next c
11 End With


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
do while loop problem April Excel Discussion (Misc queries) 4 October 18th 09 07:51 PM
loop problem teepee[_3_] Excel Discussion (Misc queries) 3 December 31st 08 11:09 AM
Does loop function cause this problem? Eric Excel Worksheet Functions 3 July 1st 07 01:40 PM
Find and Copy loop problem BillyJ Excel Discussion (Misc queries) 3 November 2nd 05 07:16 PM
strange problem For Each loop in Treeview Peter Beach Excel Programming 12 August 26th 03 02:46 PM


All times are GMT +1. The time now is 09:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"