473,508 Members | 4,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to look for a match for two values in an excel row?

In my tblOrderDetails table I have the following fields: OrderID,
OrderItemID and DeliveryDate.

I need to loop trough each row in an excel spreadsheet and find OrderID and
OrderItemID combinations that match rows in tblOrderDetails then update the
DeliveryDate field in tblOrderDetails based on the DeliveryDate held in the
corresponding row of the excel spreadsheet.

What is the most efficient way of doing this?

Assume the spreadsheet looks like this:
Column "A" = OrderID
Column "B" = OrderItemID
Column "C" = DeliverDate

Would it be something like (written in layman's terms):

For each row in tblOrderDetails _
get the value of the OrderID an OrderItemID

Then Loop through the Excel spreadsheet _
and check column "A" for an OrderID match
If an OrderID match is found _
check for a match of the OrderItemID

If both values match then
loop through the tblOrderDetails table and update the _
DeliveryDate field for that item

Is that the most efficient way of doing this. I'll worry about the actual
code later, I just want to know if I have got this bit right.

Thanks

Paul

Sep 26 '06 #1
5 1671
Create a link to the SS in your database and use an update query. Wow,
talk about making a simple problem really complicated. Just join your
Excel table to your Access table on the two matching fields.

Sep 26 '06 #2
Create a link to the SS in your database and use an update query. Wow,
talk about making a simple problem really complicated. Just join your
Excel table to your Access table on the two matching fields.

Sep 26 '06 #3

<pi********@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Create a link to the SS in your database and use an update query. Wow,
talk about making a simple problem really complicated. Just join your
Excel table to your Access table on the two matching fields.
The trouble is, the Excel spreadsheet contains a load of other garbage
(descriptions of each column and other notes) it's not just data.

:O(

Paul
Sep 26 '06 #4

Paul H wrote:
<pi********@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Create a link to the SS in your database and use an update query. Wow,
talk about making a simple problem really complicated. Just join your
Excel table to your Access table on the two matching fields.

The trouble is, the Excel spreadsheet contains a load of other garbage
(descriptions of each column and other notes) it's not just data.

:O(

Paul
as long as the table is normalized enough to query,that's irrelevant

Sep 26 '06 #5

<pi********@hotmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
>
Paul H wrote:
><pi********@hotmail.comwrote in message
news:11**********************@i3g2000cwc.googlegr oups.com...
Create a link to the SS in your database and use an update query. Wow,
talk about making a simple problem really complicated. Just join your
Excel table to your Access table on the two matching fields.

The trouble is, the Excel spreadsheet contains a load of other garbage
(descriptions of each column and other notes) it's not just data.

:O(

Paul

as long as the table is normalized enough to query,that's irrelevant
Thanks again for your reply..

I tried this and it worked. I am now stuck with the problem described here:

http://www.kbalertz.com/162539/Appea...readsheet.aspx

So I am now using DoCmd.TransferSpreadsheet to get all the SS data into
Access where I can build the queries you initially suggested.

The customer does not want to have to tinker with the spreadsheets each time
he does the import. He just wants a big red "Import" button to do all the
work. I guess I could use VBA to create a copy of the SS and strip all the
crap out of that, but there are too many variables regarding the level and
amount of crap in each SS to make that a better solution than
TransferSpreadsheet.....I think!

:O/

Paul
Sep 27 '06 #6

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

Similar topics

3
3197
by: Ray Tayek | last post by:
hi, trying to use an xslt to make an xslt. trying something like: <?xml version="1.0" encoding="UTF-8"?> <?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?> <xsl:stylesheet...
3
1409
by: Gary McGill | last post by:
I have a C# solution with a dozen or so projects. There are references between the projects, and these were all added as "Project" references. Everything's been working fine for months, but...
3
2421
by: Rich | last post by:
I am using Excel 97 and Access 97. I have two memory variables that are doubles in Access. I did the following math in Access. $28,721,211.86 / $4,263,630,151.41 In Access the answer is...
5
7218
by: Mads Petersen | last post by:
Hi, and thanks for previous help. I use following code to export from excel to access. It is executed in excel. I have an excel spreadsheet with one sheet pr. week. this code is therefore...
1
2502
by: CA | last post by:
I am having a problem getting a pointer to an existing running Excel process on a client machine. Here are some details: 1) I have tested out the code on the development machine and it works...
3
1613
by: skosmicki | last post by:
I need to create an function similar to the "MATCH" function in Excel that evaluates a number within a set of numbers and returns whether there is a match. I have put the example of what I see in...
6
7563
by: grego9 | last post by:
I am trying to return a value from an access database by looking up a value in excel. This is the code I have copied from another source - but I cannot get it to work - I keep getting a run time...
4
5879
by: keirnus | last post by:
Hello, I've been coding in Access VBA to create an Excel Graph and it was good. Until I got this error: Please check the code below: Private Sub TestGraph3()
14
20636
by: moutoncito | last post by:
Hi all, I need some help with a VBA code. I have tried differents codes that i fund in the forum but they didn t match with what i m looking for. So i will explain what i have , what i need and...
0
7228
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
7128
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
7502
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...
1
5057
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...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.