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

Importing excel data to access?

Hi!

From one of my manufacturers I get new prices in an excel spreadsheet.
Now I want to import this data to my access db.

However, there is a difference:

The items in MyAccess.db (tblItems) are like: OIL hy-123456789
and the items in NewPrices.xls are like: OIL 123456789.

(The "hy" is for separating different items with different values)

How can I write some code to import data from NewPrices.xls (about
5000 items!), have them identify same items in MyAccess.mdb and update
each item with new prices?

Hope anybody have a clue!

Me.Name
Nov 13 '05 #1
3 1548
ge***********@hotmail.com (Geir Baardsen) wrote:
The items in MyAccess.db (tblItems) are like: OIL hy-123456789
and the items in NewPrices.xls are like: OIL 123456789.

(The "hy" is for separating different items with different values)

How can I write some code to import data from NewPrices.xls (about
5000 items!), have them identify same items in MyAccess.mdb and update
each item with new prices?


Does the process need to be automated? If not, one approach would be to
import the data 'as is' and then do a 'replace' on the field inquestion,
replacing " " with "-". You can then join the two recordsets in a query and
update as necessary.

Seems too simple ... were you looking for an automated solution?

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #2
aaj
Hi Geir

as well as what Keith has already said, if you are looking at automating,
you can use VBA to open the excel document and read the data in from the
sheet. You could then automatically make the changes as your streaming the
data in, or read it to a temporary table and process the data afterwards,
plenty of choices...

If you are reasonable OK with VBA, its not difficult to do, and I can paste
you some bits of code to help you on your way.

let us know

Andy

"Keith Wilby" <ke*********@AwayWithYerCrap.com> wrote in message
news:Xn************************@10.15.188.42...
ge***********@hotmail.com (Geir Baardsen) wrote:
The items in MyAccess.db (tblItems) are like: OIL hy-123456789
and the items in NewPrices.xls are like: OIL 123456789.

(The "hy" is for separating different items with different values)

How can I write some code to import data from NewPrices.xls (about
5000 items!), have them identify same items in MyAccess.mdb and update
each item with new prices?


Does the process need to be automated? If not, one approach would be to
import the data 'as is' and then do a 'replace' on the field inquestion,
replacing " " with "-". You can then join the two recordsets in a query
and
update as necessary.

Seems too simple ... were you looking for an automated solution?

Regards,
Keith.
www.keithwilby.com

Nov 13 '05 #3
Hi!

I found the answer. I just marked the column in excel and choosed
"Edit->Replace" - tool and replaced all "." (dots) with "," (commas).

However, a new and hairraising problem withstands:

The new imported data to my access 2000 db is about 14.000 new
rows. But the column (Category) in the tblItems says 0 (null).

How can I simply change to the wright category without having to
manually click on each of the 14.000 rows in order to set the right
category?

Can I do it programatically from the front-end application, if
so...how?

Category is a field in tblItems which gets its data from
tblCategory, and is joined to tblItems.

(The db is split with only the tables as a backend on the server)
Nov 13 '05 #4

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

Similar topics

11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
2
by: nutthatch | last post by:
I want to be able to import an Excel spreadsheet into Access 2K using the macro command Transferspreadsheet. However, the file I am importing (over which I have no control) contains some records...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
1
by: Geoff Jones | last post by:
Hi I have a question which I hope somebody can answer. I have written a VB application with which I want to import an Excel file, analyze the data within it and do some calculations. There are...
1
by: winzy | last post by:
I have a table in Access which needs updating from an Excel file. Instead of importing the whole Excel like a new table in Acess, how do I do a partial import/update?? For example, Access table...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
3
by: mukeshsrivastav | last post by:
dear sir i want to move form excel to access. i have 5 excel file having same formats and fields.now i want to import all data in one access table. importing one file is easy .but importing and...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.