473,756 Members | 3,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8748
"turtle" <ko****@vistaco ntrols.comwrote in
news:11******** **************@ 74g2000cwt.goog legroups.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****@vistaco ntrols.comwrote in
news:11******** **************@ 74g2000cwt.goog legroups.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****@vistaco ntrols.comwrote in
news:11******** **************@ i42g2000cwa.goo glegroups.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****@vistaco ntrols.comwrote in
news:11******* *************** @74g2000cwt.goo glegroups.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.field 2 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
6312
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 new field table 2 has: key field (autonumber)
9
4354
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 predecessor, I hasten to add) so that each day it creates a copy of the record for each company, changes the date to today's date, and prompts the user for any changes of ratings on that day. The resulting data table grows by approx 600 records per...
5
2144
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 time to get me to learn this procedure: MY ORIGINAL POST: I am trying to create a database for my small business. I have typed a bunch of information in a table in 5 columns (style, mm, karat, quantity, labor cost). We have different labor...
4
2280
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 to a SmartList to go db. The SMtG Access sync will not allow you to sync to a query based on more than one table. And if I sync all the records in table 1 (6000)and table 2 (15,000), it take a loooooong time to sync I've got an easy solution...
8
3724
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: "Date","P1","P2","P3","P4","P5","P6","P7","P8","P9","P10","P11","P12","P13","P14","P15","P16","P17","P18","P19","P20","P21" 1/1/2005,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 1/2/2005,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
20
2510
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 insert-statements. after initalizing and starting postgres 7.4 on a different port and datadirectory, i tried to import the sql-dump with the copy statements. this import fails, but importing the dump-file with inserts took a long time but was...
1
1965
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 the page are used to call itself with querystring values for brand, thinner, finish, etc. The page must show all colors if the querystring is empty and filter out records that don't match the querystring value when it's not. I've tried building...
9
4397
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 with only one of the duplicates issue, but I got to the point where an update query with a nested select subquery would work wonderfully, if only it would work! I have several fields in a master Access 2000 table, some of which are id, fname,...
3
3967
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 = ?
0
10014
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9819
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9689
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7226
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6514
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5119
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.