473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Access ImportSpreadsheet and Wizard Give Different Default Field Names

I am using Access 2003. I've been importing Excel 2003 spreadsheets using the wizard in Access for some time now. The spreadsheet does NOT have the column names in the 1st row, so the wizard names them "Field1", "Field2", etc., by default. I decided to automate the process and I am using the following line of code:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, strFileName, FileSpec, FieldNamesInRowOne

The argument for FieldNamesInRowOne is passed either true or false, depending on my needs

When I pass it false, it works fine, but it names the fields "F1", "F2", etc.

I'm looking for an answer as to why the default field names are different. And is there a setting somewhere for the import wizard's default field name assignments?

I won't complicate it too much by adding more, but I will just say I have all of the imported files archived. It would be very useful if they all had the same field names, regardless of how they were imported.
Mar 5 '08 #1
1 1610
Denburt
1,356 Expert 1GB
You should be able to use a schema for that although you would need to use TransferText instead or first import the sheet then rename the fields.

CurrentDB().TableDefs(TableName).Fields(CurrentFie ldName).Name =
NewFieldName

As far as explaining the methodology of Microsoft..... lol Probably had different groups on different projects and they did not catch that. Since renaming the fields or using a schema can be done easily enough they probably didn't think it was a major issue. Good luck let me know how it goes.
Mar 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Scott | last post by:
I have a customer that had developed an Access97 application to track their business information. The application grew significantly and they used the Upsizing Wizard to move the tables to SQL...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
2
by: Ralph | last post by:
I'm trying to import a range of cells from an Excel spreadsheet into a table in access. The first row contains column labels, but I cannot use those as my field names, both because of their format...
1
by: usenethelp | last post by:
Has anyone had this problem where using the Text Import Wizard in Access 2002 Service Pack 3 does not allow you to change the field names for any field except the first one? If so, is there a...
0
by: Soundneedle | last post by:
(AC2003, XL2003) Can anyone explain how I can get the transferspreadsheet function to upload a sheet that has number for the field names? Access converts the field header to "F##". In other...
0
by: envywaits | last post by:
I need some help connecting my MS-Access 2003 database with a contacts list on MS-Exchange Server 2003. I can get the default field list (using the wizard) but I cannot seem to get any of the...
7
by: Andy B | last post by:
I have a class I am creating for data access. I need to access controls from inside the class that are on a particular page. How do I do this? or is creating an instance of the page class and using...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.