473,383 Members | 1,859 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,383 software developers and data experts.

Update Query or Filter Table based on another Table

I have Two tables (Table1 and Table2). Both tables have a common field
called part number. Table 1 contains an extra field that i would like
to update table 2 to match if the part number matches. I created a
join between Table1 and Table 2 but couldn't update Table 2 since the
recordset was unupdateable.

What i would like:

Table 1
Part Number Field 2
A BC b
DEX U
DFDA 6

Table 2 Field 2
ABC is null

I would like Field2 in table 2 to put in the B or at least allow me to
manually put it in without having to look up every part number
manually. If i could get a list and then copy over Field 2 that would
be fine.

KO

Aug 26 '06 #1
3 8720
"turtle" <ko****@vistacontrols.comwrote in
news:11**********************@74g2000cwt.googlegro ups.com:
I have Two tables (Table1 and Table2). Both tables have a
common field called part number. Table 1 contains an extra
field that i would like to update table 2 to match if the part
number matches. I created a join between Table1 and Table 2
but couldn't update Table 2 since the recordset was
unupdateable.

What i would like:

Table 1
Part Number Field 2
A BC b
DEX U
DFDA 6

Table 2 Field 2
ABC is null

I would like Field2 in table 2 to put in the B or at least
allow me to manually put it in without having to look up every
part number manually. If i could get a list and then copy
over Field 2 that would be fine.

KO
A simple query joined on one field should be updateable.
join on the part number. set criterai for table1.field2 "is not
null" without the quotes. set the criteria for table2.field2 as
"IS Null" without the quotes. Run the select query and see if
you can add a new record (the >* at the bottom is not greyed
out). If it is greyed out, you have some sort of problem with
the primary keys of your table.

If you can add a row, you can convert to an update query. You
could also just click in the titlebar of table1.column2 to
select all the rows, and {ctrl-C} (copy) then select tho other
column2 and paste {Ctrl-V}.

HTH
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 26 '06 #2
Bob,
thanks for the help. I have tried what you suggested but the query is
not updateable. The >* is greyed out. What kind of problem might i
have with my primary keys?

thanks for your time,
KO
Bob Quintal wrote:
"turtle" <ko****@vistacontrols.comwrote in
news:11**********************@74g2000cwt.googlegro ups.com:
I have Two tables (Table1 and Table2). Both tables have a
common field called part number. Table 1 contains an extra
field that i would like to update table 2 to match if the part
number matches. I created a join between Table1 and Table 2
but couldn't update Table 2 since the recordset was
unupdateable.

What i would like:

Table 1
Part Number Field 2
A BC b
DEX U
DFDA 6

Table 2 Field 2
ABC is null

I would like Field2 in table 2 to put in the B or at least
allow me to manually put it in without having to look up every
part number manually. If i could get a list and then copy
over Field 2 that would be fine.

KO
A simple query joined on one field should be updateable.
join on the part number. set criterai for table1.field2 "is not
null" without the quotes. set the criteria for table2.field2 as
"IS Null" without the quotes. Run the select query and see if
you can add a new record (the >* at the bottom is not greyed
out). If it is greyed out, you have some sort of problem with
the primary keys of your table.

If you can add a row, you can convert to an update query. You
could also just click in the titlebar of table1.column2 to
select all the rows, and {ctrl-C} (copy) then select tho other
column2 and paste {Ctrl-V}.

HTH
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com
Aug 26 '06 #3
"turtle" <ko****@vistacontrols.comwrote in
news:11**********************@i42g2000cwa.googlegr oups.com:
Bob,
thanks for the help. I have tried what you suggested but the
query is not updateable. The >* is greyed out. What kind of
problem might i have with my primary keys?

thanks for your time,
KO

What is the primary key in each of the two tables?
if there is no primary key, or the PK from the table you wish to
update in the query isn't in the query, this could cause the
query to be read-only.
Are the tables local or in a linked database?

In the query design mode check the Recordset Type property,
You might try setting this property to Dynaset (inconsistent
updates) instead of Dynaset.

Make sure that the unique values and unique records properties
are set to no.

Bob Quintal wrote:
>"turtle" <ko****@vistacontrols.comwrote in
news:11**********************@74g2000cwt.googlegr oups.com:

A simple query joined on one field should be updateable.
join on the part number. set criterai for table1.field2 "is
not null" without the quotes. set the criteria for
table2.field2 as "IS Null" without the quotes. Run the select
query and see if you can add a new record (the >* at the
bottom is not greyed out). If it is greyed out, you have some
sort of problem with the primary keys of your table.

If you can add a row, you can convert to an update query. You
could also just click in the titlebar of table1.column2 to
select all the rows, and {ctrl-C} (copy) then select tho
other column2 and paste {Ctrl-V}.

HTH
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com



--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 27 '06 #4

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

Similar topics

3
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
5
by: Rated R1 | last post by:
I wrote this before in the NGs, so I am going to paste the responses that I got and see if someone can please help me. Email me and we can set something up as Id even be willing to pay for your...
4
by: Brian | last post by:
I hope this will make sense. I'm trying to filter the records in a table based on records in a 2nd table. The trick is, I can't use a query. I'm trying to filter down the number of records going...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
1
by: TF | last post by:
This group came through for me last time so here we go again. My page shows paint colors, brand name, product code, etc in a gridview with the background matching the paint color. Several links on...
9
by: P3Eddie | last post by:
Hello all! I don't know if this can even be done, but I'm sure you will either help or suggest another avenue to accomplish the same. My problem may be a simple find duplicates / do something...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...

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.