Thanks John,

This is make really sense and I'm sure it will work. I remember I done this
collection of fields using ADODB.


cheers,
George


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Behalf Of John Viescas
Sent: Monday, January 16, 2006 6:42 PM
To: [email protected]
Subject: RE: [ms_access] Change Excel Column Name


George-

You could link or import the file and then in code open a recordset on it
using SELECT *.  You can loop through the Fields collection to find the
current names and generate a new (or update an old) query using alias names.
(You could also look at the Fields collection in the TableDef object.)  Your
SQL would end up looking like:

SELECT Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8,
Field9 As PrevReading, Field10 As NewReading
FROM ExcelTable

John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of George Oro
Sent: Monday, January 16, 2006 6:19 AM
To: YG Access Dev; YG Access
Subject: [ms_access] Change Excel Column Name

I want to import one excel file but before my code will execute, I want to
change first the last two columns heading into PrevReading & NewReading.

The reason is, the excel file is extracted from a different software using a
pre-defined template but the last two columns heading is the Previous
Reading & New Reading Date with their respective data. Basically each export
from the other software, the last two columns heading will change according
to date reading so its not fixed at all.

The exported excel file is always composed of 10 columns and save in the
same directory and file name.

Any tips would be greatly appreciated.

TIA
George





[Non-text portions of this message have been removed]




Yahoo! Groups Links











Yahoo! Groups Links









 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to