473,505 Members | 14,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ACCESS 2007: Updating Multiple tables

16 New Member
Good day,
Having a total brain fart on this and need some help.

Access 2007
2 Tables

Table1: Director (200 records)
Field1: Name
Field2: phone

Table2: Order_Summary (414,000 records)
Field1: Name
Field2: orders

Director!name to Order_summary!Name Relatioship

Desire:

Enter Company Name to Change (user enters name)VAR1.
Enter New Company Name (what ever company was renamed to)VAR2.

FIND VAR1 in Director!Name and Order_summary!Name and update (both tables)!name to equal VAR2.

The largest issue I am having; what is the best way to grab and modify the data in both tables. I know how to do it the sloppy way, but with this many records I fear it may bloat.

Appreciate your help!

Thanks again,

Kendall
Nov 29 '11 #1
3 4816
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
You can run an update query to update both fields at the same time.

Expand|Select|Wrap|Line Numbers
  1. UPDATE Director INNER JOIN Order_Summary 
  2.   ON     Director.[name] = Order_Summary.[name] 
  3.   SET    Director.[name] = "NewName", 
  4.          Order_Summary.[name] = "NewName"
  5.   WHERE  Director.lng_ProjectNr="OldName"

Another option would be to open the relationship manager, and modify the relation. Make sure that "Cascading updates" is enabled for the join, and then go and update your record in the Director table.


Now that all that is said, you should avoid using the field name Name as that is a reserved word in Access and will only cause you weird errors down the road.

You also need to take a look at:
Database Normalisation And Table Structures
Nov 29 '11 #2
phillikl
16 New Member
Thanks TSC! That was the road I was thinking, just needed a reality check.

Understand all on the naming convention; just wanted to make the example as simple as possible.

Thanks again for your help,

Happy Holidays,
Kendall
Nov 30 '11 #3
NeoPa
32,557 Recognized Expert Moderator MVP
Happy holidays to you too Kendall, but please remember to select Smiley's post as Best Answer before you start :-)
Nov 30 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1882
by: PMB | last post by:
Thank you in advance for any and all assistance. I have a small program that I'm tracking accounts rec. and I want to keep data, stored by day and have a month end. I have a form called...
1
1579
by: JLM | last post by:
I'm sure this has been addressed before, but I haven't found it yet. I have a form that I want to use to update multiple tables (with same/similar info). I can append a single table without much...
1
2562
by: Justin | last post by:
What is the best/easiest way to update multiple tables at a time? Can you recommend any tutorials? Thanks, Justin.
1
1540
by: evandela | last post by:
Hi all... this is one part of ASP.net that i just dont understand... and GOD knows, i am trying. I have 2 tables, the first one called country and the second called product I create a datagrid...
1
4097
by: Rob Dob | last post by:
Hi, I have both a Customer and a Orders Table, the key field is CustomerID. I also have a DataGridView that uses a BindingSource created using a join between the Customers table and the Orders...
1
2367
by: bbcdancer | last post by:
I have a database table called "tbl_personal" and struggling to VBA program a bit of code to create multiple tables in a database from the main "tbl_personal" table. In this case the 'color'...
13
42846
by: srinivas gandrath | last post by:
Hi all, I am having trouble to writing stored procedure to insert and update the 2 tables in sql server 2005. Here is my problem. I have 2 tables with following columns. TableName:BENEFIT_PDF...
4
2775
by: cpamerlin | last post by:
Given the following Access database items: CityTable: ------------------- ID City 1 Memphis 2 Los Angeles 3 Tucson 4 Sacramento 5 Austin
15
4262
by: Clint Nelson | last post by:
Thanks to all in advance... I have two tables... corporations... ID corpname corpnumber address 1 widgets 123456 1122 3rd 2 acme 234567 123 4th st 3 engineers 345678...
1
4244
by: engrlorie | last post by:
I have four tables in access 2003: T1 (8 fields), t2 (5 fields), t3 (7 fields), t4 (3 fields) all connected to each other with t1.a = t2.a, t1.a=t3.a, t1.a=t4.a (T2, T3 and T4 contains the FK for T1....
0
7216
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
7098
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
7303
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,...
1
7018
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
7471
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
5028
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
3187
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
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
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.