PC Review


Reply
Thread Tools Rate Thread

ADO Recordset include Field names

 
 
=?Utf-8?B?S2lyayBQLg==?=
Guest
Posts: n/a
 
      18th Apr 2007
How do I modify this code to get the Field names from rec6 to start in column
13? They currently start in column 1, and I've tried modifying it several
ways - so far no luck.

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6

Thanks!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      18th Apr 2007
try it this way:

For nCol = 1 To rec6.Fields.Count
Sheets("ACN").Cells(7, nCol+12).Value = rec6.Fields(nCol - 1).Name
Next nCol
Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6


--
Hope that helps.

Vergel Adriano


"Kirk P." wrote:

> How do I modify this code to get the Field names from rec6 to start in column
> 13? They currently start in column 1, and I've tried modifying it several
> ways - so far no luck.
>
> For nCol = 1 To rec6.Fields.Count
> Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
> Next nCol
> Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6
>
> Thanks!

 
Reply With Quote
 
=?Utf-8?B?S2lyayBQLg==?=
Guest
Posts: n/a
 
      18th Apr 2007
Perfect, thanks!

"Vergel Adriano" wrote:

> try it this way:
>
> For nCol = 1 To rec6.Fields.Count
> Sheets("ACN").Cells(7, nCol+12).Value = rec6.Fields(nCol - 1).Name
> Next nCol
> Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6
>
>
> --
> Hope that helps.
>
> Vergel Adriano
>
>
> "Kirk P." wrote:
>
> > How do I modify this code to get the Field names from rec6 to start in column
> > 13? They currently start in column 1, and I've tried modifying it several
> > ways - so far no luck.
> >
> > For nCol = 1 To rec6.Fields.Count
> > Sheets("ACN").Cells(7, nCol).Value = rec6.Fields(nCol - 1).Name
> > Next nCol
> > Sheets("ACN").Cells(8, 13).CopyFromRecordset rec6
> >
> > Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading field names from dao.recordset janiotjoeawie via AccessMonster.com Microsoft Access Form Coding 2 28th Oct 2007 11:07 AM
adding using recordset does not include linked field of subform =?Utf-8?B?TFZlcg==?= Microsoft Access Form Coding 1 14th Sep 2007 08:38 PM
Report to aggregate all the people's names of the field [NAMES] recordset. Joe M Microsoft Access Reports 5 18th Jan 2005 11:32 AM
Report to aggregate all the people's names of the field [NAMES] recordset. Joe M Microsoft Access Queries 5 18th Jan 2005 11:32 AM
Recordset field names Michael Microsoft Access VBA Modules 4 8th Jun 2004 07:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:37 AM.