Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 18th, 2004, 06:56 PM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
updating related tables

G'day all. I have a master data table that links with a bunch of other tables. If I add another record to the master data table, how do I force the primary key of the new record to slot into my other tables?? For example. If I enter and ID number in a master table, I'd like the new ID to appear in all related tables as well. I need to do this so that my queries will work and return matching records. Enforcing referential integrity only updates existing records. Is there some way I can do this without having to run an update query everytime I enter a new record?? I appreciate any advice.
__________________
Damo
Have you Kissed the Bride lately?

Reply With Quote
  #2  
Old January 21st, 2004, 12:50 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
There is a cleaner way to do this then actually addin the Blank Child Records.

In you query, you can change the porperties of the relationships themselves between the different tables (Double click on the relationship itself). There is the options that states:

Show me all records in Table1 and all records in Table2 Where they fields are equal

This is called and Right (or Left) Join in SQL code. This makes it so that all you Master table records will show up, regardless if the existing in another record.

If you still need to know how to added Blank records you will have to use ADO or DAO VBA Code to do this. Let me know and I will send you a sample DB

S-

Reply With Quote
  #3  
Old January 23rd, 2004, 10:34 PM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
My data base keeps records of student test scores over a number of years. Each student has an ID number which became my primary key. I kept scores in different tables for different years. Doing it this way, I found serching a little clumsy. So I threw all my data into one master table. I then had to use an auto number as a primary key because I had duplicate ID numbers. Relationships seem to only work with primary keys and the auto numbers don't really mean anything. Is there a better way to organise my data??

Reply With Quote
  #4  
Old January 26th, 2004, 09:09 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
With Relationships, only one of the field being related back in forth between two tables needs to be unique (not neccesarily the primary)



Here is one alternative to set up your tables without using the autonumber (that you seem to not like)

Student Table
StudentID (PK)
StudentNAme

Student grades Table
StudentID (PK/FK)
StudentTestYear (PK)
TestScore


Here is an alternative with the autonumber

Student Table
StudentID (PK)
StudentNAme

Student grades Table
AutoNumber (PK)
StudentID (FK)
StudentTestYear
TestScore

Based on what you are saying here is two alrernatives. Now if I didn't undersatand you, post a copy of your DB design and I will look at it.

S-

Reply With Quote
  #5  
Old January 28th, 2004, 03:51 AM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
sbaxter

Thanks for your ongoing help. Attached is a sample of a few tables. Any advice on how I can better organise my data so that I can get better performance from my data base is much appreciated. Thanks again.
Attached Files
File Type: zip tables.zip (19.8 KB, 204 views)

Reply With Quote
  #6  
Old January 28th, 2004, 09:42 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I need more information on what your DB is suppose to do. What are you storing? Do you include a new record in "data GO assessments" for each year? Etc.

S-

Reply With Quote
  #7  
Old January 28th, 2004, 05:03 PM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
I'd love to zip the whole thing up and send it but I'm restricted to a size limit.

Basically the database tracks student progress. If I have an interview with a parent I want to call up a student history to better manage what's the best course of action.

The data master table contains student data EQID, year, Name, class etc... In the other tables I simply append EQID and year ONLY and the queries fill the other data. Because students are at primary school for seven years, the data master table will have the same student 7 times with the same EQID but the year will be different. The same will happen in the other tables (a replica EQID and year date) I then just make up a query and match up the EQID and year. periodically I update the tables with new students. Is this the best way to do this?? Thanks for your help.

Reply With Quote
  #8  
Old January 28th, 2004, 05:11 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Quote:
Originally posted by dtayl20
I'd love to zip the whole thing up and send it but I'm restricted to a size limit.



Goto Yahoo Breifcase and get your self a Free FTP site. IT will let you FTP up to 5Meg files.

The send me a Private message telling me the username and password and I will doenload your DB

S-

Reply With Quote
  #9  
Old January 28th, 2004, 06:46 PM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
you may need the security file as well. here's the data base.
http://www.schools.ash.org.au/macgregorps/kid tracking new version.mdb

Reply With Quote
  #10  
Old January 28th, 2004, 10:04 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
The page cannot be found

when I use your link

S-

Reply With Quote
  #11  
Old January 28th, 2004, 11:58 PM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11

Reply With Quote
  #12  
Old January 29th, 2004, 12:00 AM
dtayl20 dtayl20 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Brisbane Australia
Posts: 324 dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level)dtayl20 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 19 h 33 m 34 sec
Reputation Power: 11
copy the whole line into your web address bar

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > updating related tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |