473,468 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can this be done?

I have an Excel file that has list of serial numbers followed by a 4 digit
code. I have an Access database that has the serial numbers but the field
for the 4 digit code is either blank, has the 4 digit code, or contains 4
X's.

What I would like to do is go through each record in Access, check the
serial number and then compare that serial number with the one in the Excel
spreadsheet. If the serial number in Access has a NULL value or a string of
four X's then I would like extract the 4 digit code from the Excel
spreadheet and populate the 4 digit code in the corresponding field.

Can I do this with VB and Access? How difficult do you professionals think
this might be. I am only a novice programmer.

I hate to think of doing this by hand. We have about 40,000 records to
update.

Your thoughts and advice are well appreciated.

Kathleen
Nov 12 '05 #1
4 2948
> I have an Excel file that has list of serial numbers followed by a 4 digit
code. I have an Access database that has the serial numbers but the field
for the 4 digit code is either blank, has the 4 digit code, or contains 4
X's.

What I would like to do is go through each record in Access, check the
serial number and then compare that serial number with the one in the Excel
spreadsheet. If the serial number in Access has a NULL value or a string of
four X's then I would like extract the 4 digit code from the Excel
spreadheet and populate the 4 digit code in the corresponding field.

Can I do this with VB and Access? How difficult do you professionals think
this might be. I am only a novice programmer.


Is there some value (or set of values) in the Excel "table" that would link each
record to it's corresponding record in the Access table? If not, it's unlikely
that this could be done with an update query or even using VBA.

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2
Thank you. I appreciate your quick response.

Each serial number and 4 digit code is unique. There are no two alike. The
file of serial numbers that was provided to me is over 1051 pages with each
page containing well over 100 serial numbers. Not all of them are in use.
I have an Access database with the serial numbers and a field for the 4
digit code. But over the past 2 years employees have been either leaving it
blank or putting 4 Xs in it when they could not find the code.

My head honcho would like to see our MS Access DB, which is about 40,000
records strong, to reflect the 4 digit codes. What will be requested is
thaat I assign 4 employees the task of manually updating these fields. I
think there has to be a better way.

Thanks again.

Kathleen


Bruce M. Thompson <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vn************@corp.supernews.com...
I have an Excel file that has list of serial numbers followed by a 4 digit
code. I have an Access database that has the serial numbers but the field for the 4 digit code is either blank, has the 4 digit code, or contains 4 X's.

What I would like to do is go through each record in Access, check the
serial number and then compare that serial number with the one in the Excel spreadsheet. If the serial number in Access has a NULL value or a string of four X's then I would like extract the 4 digit code from the Excel
spreadheet and populate the 4 digit code in the corresponding field.

Can I do this with VB and Access? How difficult do you professionals think this might be. I am only a novice programmer.
Is there some value (or set of values) in the Excel "table" that would

link each record to it's corresponding record in the Access table? If not, it's unlikely that this could be done with an update query or even using VBA.

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access) NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<

Nov 12 '05 #3
"Kathleen Turner" <kt*****@visuallink.com> wrote in message
news:vn************@corp.supernews.com...
I have an Excel file that has list of serial numbers followed by a 4 digit
code. I have an Access database that has the serial numbers but the field
for the 4 digit code is either blank, has the 4 digit code, or contains 4
X's.

What I would like to do is go through each record in Access, check the
serial number and then compare that serial number with the one in the Excel spreadsheet. If the serial number in Access has a NULL value or a string of four X's then I would like extract the 4 digit code from the Excel
spreadheet and populate the 4 digit code in the corresponding field.

Can I do this with VB and Access? How difficult do you professionals think this might be. I am only a novice programmer.

I hate to think of doing this by hand.


Me too!

You seem to be mixing up your terminology, in your 2nd para you talk about
the serial number in Access being null or a string of 4 X's. Do you mean the
code? I assume you do.

You've got:

Excel file:
serial# code
100302 2435
349098 3458
etc.

Access table
serial# code
100302 NULL
349098 3458
324554 XXXX
etc.

Yes? And once this stuff is all into Access then you can discard the Excel
file?

First of all get you Excel table into Access. In Access File/Get External
Data/Import. You'll get a wizard asking you questions about how you want to
import. I don't know what the format is in Excel, so do you best there.
Anyway you'll end up with a new table in Access.

So you've now got 2 tables. I'll call them accessData and excelData. Make a
new query. Add those two tables. Join them on serial#:

SELECT accessData.[serial#], accessData.code, excelData.[serial#],
excelData.code
FROM accessData INNER JOIN excelData ON accessData.[serial#] =
excelData.[serial#];

Make sure the records 'line up' how you expect.

Change the query to an update query. And change the SQL to this:

UPDATE accessData
INNER JOIN excelData
ON accessData.[serial#] = excelData.[serial#]
SET accessData.code = [excelData].[code]
WHERE (((accessData.code)="xxxx")) OR (((accessData.code) Is Null));

You don't have to run it yet. Click the datasheet icon to see what WILL be
changed when you do run it. OK? then run it (Query/run). Change it back to
the first SELECT query. Does that look like what you expected?

That's if I've understood what you want. I'd strongly advise you to do all
this on a copy of the database first. There are all sorts of questions about
the data too. Is serial# unique? Are you sure that the only values in code
are a valid code, "xxxx" or null? If serial# is unique (or meant to be) then
I'd set unique a unique index on it to make sure.

HTH, Mike MacSween


Nov 12 '05 #4
I'm still not absolutely clear about the layout of the Excel spreadsheet.

Your description implies two scenarios to me
1) A column of serial numbers and a second column of codes
or
2) A column containing the serial number and code in combination

************************************
No matter what you do always try your update strategy against copies of your
Access database and Excel spreadsheet first before doing a live run
************************************

With scenario 1
a) link to the speadsheets from Access.
b) Run update queries to copy from the code column in the linked Excel
sheets to the code column in your Access table.

Exactly how you do b) this depends on whether the serial numbers are unique
or whether the Serial number/code is unique.

With Scenario 2
a) link to the speadsheets from Access.
b) run queries to split the serial number and code out into temporary
Access tables
c) Run update queries to copy from the code column in the temporary
Access tables to the code column in your Access table.

Exactly how you do c) this depends on whether the serial numbers are unique
or whether the Serial number/code is unique.

Terry
"Kathleen Turner" <kt*****@visuallink.com> wrote in message
news:vn************@corp.supernews.com...
Thank you. I appreciate your quick response.

Each serial number and 4 digit code is unique. There are no two alike. The file of serial numbers that was provided to me is over 1051 pages with each page containing well over 100 serial numbers. Not all of them are in use.
I have an Access database with the serial numbers and a field for the 4
digit code. But over the past 2 years employees have been either leaving it blank or putting 4 Xs in it when they could not find the code.

My head honcho would like to see our MS Access DB, which is about 40,000
records strong, to reflect the 4 digit codes. What will be requested is
thaat I assign 4 employees the task of manually updating these fields. I
think there has to be a better way.

Thanks again.

Kathleen


Bruce M. Thompson <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vn************@corp.supernews.com...
I have an Excel file that has list of serial numbers followed by a 4 digit code. I have an Access database that has the serial numbers but the field for the 4 digit code is either blank, has the 4 digit code, or
contains
4 X's.

What I would like to do is go through each record in Access, check the
serial number and then compare that serial number with the one in the Excel spreadsheet. If the serial number in Access has a NULL value or a string of four X's then I would like extract the 4 digit code from the Excel
spreadheet and populate the 4 digit code in the corresponding field.

Can I do this with VB and Access? How difficult do you professionals think this might be. I am only a novice programmer.


Is there some value (or set of values) in the Excel "table" that would

link each
record to it's corresponding record in the Access table? If not, it's

unlikely
that this could be done with an update query or even using VBA.

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
> NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<


Nov 12 '05 #5

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

Similar topics

0
by: itsharkopath | last post by:
Hi, Imagine a user in a hotspot, when he comes to the hotspot and tries to load a webpage (on the internet), he would automatically redirected to login page. I believe the following is to be...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
16
by: jaialai technology | last post by:
I want to reload a url in a browser window so I do something like this: open(window.location.href= "www.yahoo.com"); ok, so now I want to do something when that page is done loading completely....
5
by: Morten Overgaard | last post by:
Hi I have a C# component which fires events. I want to catch these events in my MFC app compiled with the /clr. I know I can define a managed class in my MFC app which traps the events - but I...
11
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to...
3
by: Miguel Dias Moura | last post by:
Hi, When I subscribe a web site I usually receive an email to confirm my subscription. Only after I follow the link in the email my account gets activated. In general, how is this done? Can...
4
by: BrianDH | last post by:
Group Early this week I ask for examples on how to call a VB.NET Web Service and access its DataSet for a traditional ASP page. I was told, "you can't", "won't work", "not possible". Well I...
12
by: Ark | last post by:
Hello NG, I arrange data in structs like { members... uint16_t crc; more members, maybe... } Then I need to save them, up to and including crc, in non-volatile memory or a file, as the case...
2
by: maya | last post by:
http://news.yahoo.com/news?tmpl=index2&cid=703 down the page, under "More Stories", there's a section with two interchangeable divs which slide back and forth into view.. how is this done? I...
2
by: poolboi | last post by:
hey guys, i've done most of my web app. for searching almost done but then i got a small little problem with logging in i need to know how session tracking is done in perl if not my log in page...
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
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
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...
1
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...
1
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
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 ...

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.