+ Reply to Thread
Results 1 to 8 of 8

Help with looping/dumping recordset

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    73

    Help with looping/dumping recordset

    Hey guys,

    Have a feeling I'm over-complicating this one... I just want to loop through three different recordsets and dump one field.

    I have the loop so it begins at i = 7, so we start at range B7 and move down to B8, and so on until we have moved down the number of records. please let me know if I can clarify:

    Please Login or Register  to view this content.

    The error I get is, "Either BOF or EOF is True, or the current record has been deleted". However, there is one record for the first recordset, 5 for the 2nd and 4 for the 3rd. To note, it does successfully write the one record before kicking out the error.

    Any ideas? Thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with looping/dumping recordset

    Can't you use CopyFromRecordset?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Help with looping/dumping recordset

    Thanks for the response, Norie!

    I now get the error, "Class does not support Automation or does not support expected interface" when I run this:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with looping/dumping recordset

    You don't need the loop, all you need is this.
    Please Login or Register  to view this content.
    PS I'm assuming the recordset only has one field, 'Comments'.

  5. #5
    Registered User
    Join Date
    11-28-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Help with looping/dumping recordset

    Unfortunately, there are several fields in the recordset. The only field I want is "COMMENTS" though.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with looping/dumping recordset

    Are you doing anything with the other fields in the recordset?

  7. #7
    Registered User
    Join Date
    11-28-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Help with looping/dumping recordset

    No. I am pulling from a View stored in our Oracle database, so I went that route for convenience sake, but don't have need for the other fields.

    EDIT: I see your point. Just pull the one field and I can keep the where clause as-is.

    EDIT2: Okay, changed query from:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    The cost sheet is copying over correctly, but not the quality or schedule sheets. Probably just missing something small
    Last edited by jsabo; 09-17-2015 at 05:31 PM.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help with looping/dumping recordset

    Yep, just pull the one field.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Open another recordset within current recordset vba
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-02-2015, 04:32 AM
  2. Dumping info and performing calculation
    By tapsmiled in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2014, 04:15 PM
  3. Dumping to a text file...
    By timbreeding in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2009, 11:43 AM
  4. Dumping Values onto Col H
    By T De Villiers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2007, 09:41 AM
  5. Dumping Data
    By T De Villiers in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2006, 09:00 AM
  6. [SOLVED] Recordset's RowID as part of Recordset
    By Trip in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2005, 06:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1