473,402 Members | 2,050 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,402 software developers and data experts.

Import Excel into Access Table

I've got an excel sheet that I need to import into a table, however, I
want the function to automatically manipulate the data prior to it
being imported.

For example, i have a field called [Flt No] and the format is 16107 for
example, when the VBA function is running I want it to add "EA" to the
record so it becomes EA16107 but the field I want it to import into is
called [ORDNO]

another field in the same dataset I want to import is [Product], this
field has many different product descriptions which I want to
manipulate prior to being imported.

I want to convert the following:

Premium UL - PULP
ULP - ULP
Ultimate - PULP
Unleaded Motor Spirit - ULP
LPG - LPG
Autogas - LPG
Monthly AD - Monthly AD

Any help would be wonderful, ps: I'm still an amateur in VBA

Jun 12 '06 #1
3 7412
"Santa-D" <st*****@forgone.org> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
I've got an excel sheet that I need to import into a table, however, I
want the function to automatically manipulate the data prior to it
being imported.

For example, i have a field called [Flt No] and the format is 16107 for
example, when the VBA function is running I want it to add "EA" to the
record so it becomes EA16107 but the field I want it to import into is
called [ORDNO]

another field in the same dataset I want to import is [Product], this
field has many different product descriptions which I want to
manipulate prior to being imported.

I want to convert the following:

Premium UL - PULP
ULP - ULP
Ultimate - PULP
Unleaded Motor Spirit - ULP
LPG - LPG
Autogas - LPG
Monthly AD - Monthly AD

Any help would be wonderful, ps: I'm still an amateur in VBA


Is this a one-off import or something regular? If it's a one-off, copy your
data into the destination table then use an update query to append the
prefixes.

If this is something regular and you're new to code then post back. It
would also be useful to know what version of Access and which OS you're
using.

Regards,
Keith.
www.keithwilby.com
Jun 12 '06 #2
> If this is something regular and you're new to code then post back. It
would also be useful to know what version of Access and which OS you're
using.


Hi Keith,

I'm using Windows XP-SP2 & MS Access 2003.
Yes, it would be a regular thing and I would probably manipulate the
code and adopt it elsewhere within the system I'm building.

Jun 12 '06 #3
"Santa-D" <st*****@forgone.org> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
If this is something regular and you're new to code then post back. It
would also be useful to know what version of Access and which OS you're
using.


Hi Keith,

I'm using Windows XP-SP2 & MS Access 2003.
Yes, it would be a regular thing and I would probably manipulate the
code and adopt it elsewhere within the system I'm building.


If you have not yet applied SP2 to Office 2003 then you can use the linked
table method to connect to Excel from Access and use the linked table as you
would a native table. Therefore you can use an append query with calculated
fields (eg Expr1: "EA" & [Flt No]).

If you have SP2 applied then the linked table method will not work with
Excel. This makes linking to Excel relatively tricky compared to the linked
table method. You'd need to first set a reference to the Excel object
library in your VBA project. You'd then need to use some code to connect to
your spreadsheet. This method is known as "Office Automation" and was new
to me until recently.

I was going to post a shed load of code at this point but I learned about
automation by reading a book and I would recommend you do the same so that
you get a good understanding rather than "monkey see, monkey do". The book
I used was this:

http://www.amazon.com/gp/product/059...Fencoding=UTF8

There is another option to consider - do you really need to store these
prefixes? If they're consistent then you can import the data as is and use
select queries at run-time to append them to form and report controls.

HTH - Keith.
www.keithwilby.com


Jun 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bob C. | last post by:
Question: Why would I not be able to import an Access 97 table in which some records have null values in fields that allow null values? Wouldn't the table's design be imported first, bringing...
1
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
2
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
6
by: Paul | last post by:
I was wondering if anyone has had an issue where using vba code to read an excel file and import the data into an access table some records are not imported from the excel file. It seems looking at...
2
by: amy | last post by:
Hi, all: i am a new end user of access, now I have many excel files need to import to One table in access (combine all excel files into one table in excel). In excel files, some columns will have...
2
by: john | last post by:
I have 400 different Excel-spreadsheetfiles, same structure, all with only one record in it, and all residing in the same folder. Every now and then new Excel files are being added. In my Access...
2
by: ruthboaz | last post by:
Hi, I am exporting a table with data to an excel file.. Some fields are empty in the exported file while the others and the key field, has values. The empty field(s) in excel, will be entered...
1
by: Tammy Viola | last post by:
I would like to import an Excel Worksheet as a new table in the backend of an Access database. Looked at using docmd.TransferSpreadsheet without success. Also looked at creating a table using...
1
by: SAHMAD | last post by:
how can i import ms access table to oracle
15
by: OfficeDummy | last post by:
Hello all! I searched the Internet and this forum for a similar problem, but I found no help... Also, I'm a complete newbie to the fascinating world of programming, VBA and Access, so my question...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.