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

How can I update identical fields in several tables by only entering in one?

Hello all you brillaint people who might be able to help me.

I've recently become treasurer for a small club and need to create a membership database.

Now I'm almost a complete newbie at Databases - but i have managed to make small inroads.

What I need it some way to make it so that when I enter a new record in the Membership Table, it is also created and filled out in the common fields in the membership Dues Table - they have a name and number field in common (Brcause the Dues page needs to be printed and posted at the club).

If helpful I can mail the empty database, however much is in Danish.
Nov 26 '06 #1
7 1732
NeoPa
32,556 Expert Mod 16PB
The short answer to that is that it's not a good approach to synchronise updates.
What you should aim to do is store the information only once.
Then you use queries that connect tables together, to find and show all the info you need.
For instance, if you had four people living in a house and they each used the same phone,. You wouldn't store the phone number with each person. Instead you'd connect each person to a 'House' table and store the phone number in there.

If you need help doing this just post the question in here.
You will need to provide more detailed information though. Databases and coding depend very heavily on the details (tables; fields; logical connections between the tables; etc).
Nov 26 '06 #2
Ok - here's a breakdown of what I'm trying to accomplish:

One table is to include Number, Name, Adress, Telephone number, E-Mail, Type of Membership and Method of payment.

This is the membership list.

One other table is to include Number, Name and a column for each month.

This is the Membership Dues list.

They have the name and number column in common now because the dues list needs to be published at the club - and I need all the info at home so it is also in the other list.

I have created the two tables as they are written here, and have created a form to allow me to enter a new member into the Membership List Table. I have also managed(somehow) to create a relationship link between the two so that it is possible via a submenu to see the dues list in the membership list by click the small + that appears.


Ideally I would like it so that when I create a new member in the first table it is also generated in the second table. I can see how a query might be best for getting a printable list - but they still need a column in common, and I still have to create the second one by hand.
Nov 26 '06 #3
NeoPa
32,556 Expert Mod 16PB
Ok - here's a breakdown of what I'm trying to accomplish:

One table is to include Number, Name, Adress, Telephone number, E-Mail, Type of Membership and Method of payment.

This is the membership list.

One other table is to include Number, Name and a column for each month.

This is the Membership Dues list.

They have the name and number column in common now because the dues list needs to be published at the club - and I need all the info at home so it is also in the other list.

I have created the two tables as they are written here, and have created a form to allow me to enter a new member into the Membership List Table. I have also managed(somehow) to create a relationship link between the two so that it is possible via a submenu to see the dues list in the membership list by click the small + that appears.


Ideally I would like it so that when I create a new member in the first table it is also generated in the second table. I can see how a query might be best for getting a printable list - but they still need a column in common, and I still have to create the second one by hand.
You can link the two tables (in Relationships as well as any query) by the Number field (I would call it MemberID rather than Number though for clarity).
Remove the Name field from the Membership Dues table.
Create a query (qryMembershipDues) with the following SQL (or something similar which exactly matches your field and table names).
Expand|Select|Wrap|Line Numbers
  1. SELECT [M].[MemberID], [M].[Name], [M].[Address], [M].[Telephone number], 
  2.    [M].[E-Mail], [M].[Type of Membership], [M].[Method of payment],
  3.    [D].[Column]
  4. FROM [Membership] AS [M] INNER JOIN [Membership Dues] AS [D] ON
  5.    [M].[MemberID]=[D].[MemberID]
You can now build a form (and subform) in your database, on top of this query, by using the Forms Wizard.
This can automatically link the parent form (membership) with the sub-form (membership Dues) and show a correct logical connection between the two.

Before you do any of this though, I would advise creating a one-to-many reference between the two tables with full referential integrity enforced (including propagation of updates and deletes).

PS. I would advise making a backup of your database file before making any such fundamental changes. This would be no exception. Good luck & let us know how you get on.
Nov 26 '06 #4
Well, sofar I get the query granting me the name and number for the printable dues page I ned to generate - but all the columns for the 12 months are missing.

The page I need to generate should look something like this:

Number, Name, Jan, feb, Mar, Apr, May, June, July, Aug, Sept, Oct, Nov, Dec

In the field names across - and each members data listed below.

the name field needs to be taken from Table 1: Membership List - and the rest taken from Table 2: Membership Dues.

The above listed SQL does not do this.

And I can only get it to allow me to create a one-to-one relationship between the number fields in the two tables.

ANY help is greatly appriciated btw. I know it is most likely me that is dense on this.
Nov 26 '06 #5
PEB
1,418 Expert 1GB
Hi

If you have in your due table a column where you store the information of the month, named Month, ie

So the only thing you can do is using a Crosstab query..

This can be created from Queries->Query design

From the menu u choose Query->Crosstab Query

Than something special happens... It appears 2 complementary rows:
Group By
And
Row with those choices: Row heading, Column Heading, Value

Mark under all of your fields Row Heading except the Month. Under it select Column Heading

Under the column duty select Value and choose instaed group By, the function Sum

When you display the query in datasheet you will see the query as u want to see it!
Nov 26 '06 #6
NeoPa
32,556 Expert Mod 16PB
What PEB says is certainly a possibility, but there are others.
I didn't include any of those field in the query I posted because I'd not been told about them :S.
The best thing is for you to post details of the tables you use with their exact names and the names and types of all the fields in them.
That way we know what we're dealing with and we can come up with an appropriate solution.
Nov 26 '06 #7
NeoPa
32,556 Expert Mod 16PB
Another way, if you feel up to it, is to take the SQL I posted and paste it into a new query (Create new query; go into SQL view; Paste in SQL).
When that's done, view it in Design view and make the changes you know you need.
If you hit difficulties then try the other method (post all the details requested in here).
Nov 26 '06 #8

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

Similar topics

8
by: Jan van Veldhuizen | last post by:
The UPDATE table FROM syntax is not supported by Oracle. I am looking for a syntax that is understood by both Oracle and SqlServer. Example: Table1: id name city ...
5
by: rdraider | last post by:
Hi all, I'm looking for a way to re-number inventory items. The items exist in 50+ tables, hundreds of fields and there are several thousand items. Maybe one table could hold the list of old &...
2
by: MLH | last post by:
We have a table (tblClients) with several thousand records. Because of organizational structure, changes to those records are maintained in a separate database. Weekly, about a dozen or so clients...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
1
by: Melepoil | last post by:
Hi All, I have a query to get selected fields from two tables in an SQl server. I made a make query table to get these data to a table. Whenever there is a change in the databse (the...
3
by: wildbill | last post by:
I have an Excel spreadsheet with 1000+ rows that I need to import into an Access 2002 db once a month or so. I then need to use that information to update any existing records(multiple fields may...
4
by: Lada 'Ray' Lostak | last post by:
Hello there, I am thinking how to solve another typical problem of online systems with combination of thin client... Imagine simple case, 2 users are going to edit 'same' datas. Both see on the...
35
Curben
by: Curben | last post by:
Hello all, two days of websearching and I cannot find an answer yet. Reasonably new to access development. Access 2000 DB using access 2003 on windows XP I am having an issue with creating a...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.