Started By
Message

re: Any Microsoft Access Experts?

Posted on 1/17/14 at 1:25 pm to
Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:25 pm to
I have foreign keys set up from the unique ID key in main database to the foreign keys in each of the separate competitive team tables. The problem is that the ID never transfers when I create a new record in the main database.

And I sincerely appreciate the help, even though I might sound retarded.
This post was edited on 1/17/14 at 1:26 pm
Posted by Korkstand
Member since Nov 2003
28712 posts
Posted on 1/17/14 at 1:25 pm to
quote:

How do I make it xfer then? And is there an easier way to do what I'm trying to do? It's really not a complicated table, but this is the main piece I'm missing.

The point of relational databases is so you don't have to transfer or duplicate information. The foreign key is there for the purpose of linking a record in one table to a record(s) in another, and you gather the information you need via queries rather than thinking of it like you need to read a spreadsheet and see all the info on one "sheet".
Posted by Tortious
ATX
Member since Nov 2010
5142 posts
Posted on 1/17/14 at 1:28 pm to
Your design is the problem I think. See the long post aboout 2 above. You need an alumni table, a team table, a competition table, and then a "results" table to store the combinations. So my alumni Id, team Id, and competition id would be stored.So if I'm A,on team B, inn competition C the results table would store ABC in a row (separate columns). Then if I'm on team B, but in competition D it would store ABD.
Posted by davesdawgs
Georgia - Class of '75
Member since Oct 2008
20307 posts
Posted on 1/17/14 at 1:29 pm to
I suggest that your either 1. study relational database theory/understand the relational model or 2. if you are not willing to invest in this learning you might be better off just using Excel.
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:30 pm to
quote:

I think your design maybe part of the problem. If someone is on two teams would you want the data in both team tables right?

Lets start with table design. In the simplest(it's normalized but simple) form what I would do is have four tables.
PKs are bold, FKs are Italics
Alumni
Al_ID, Name, Info Fields....

Alumni_team_xref
Al_ID, Team_ID

Team_Master
Team_ID, Desc_Fields...

Competitions
Comp_ID, Team_Id, Comp_date, Detail fields...
This post was edited on 1/17/14 at 1:41 pm
Posted by Doldil
The Ham
Member since Jan 2010
6214 posts
Posted on 1/17/14 at 1:31 pm to
quote:

The problem is that the ID never transfers when I create a new record in the main database.


you're going to have to write a query that does this...nothing is going to just transfer over. You essentially need like a stored procedure that updates everything on a submit button or something (if I'm reading it correctly)
Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:32 pm to
That makes perfect sense, I'm just not sure how to execute it. Do you have a junk email I could send you the db when I finish it (doing it the way you just described)?
Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:32 pm to
So it's the same design tortious is recommending?
Posted by Korkstand
Member since Nov 2003
28712 posts
Posted on 1/17/14 at 1:33 pm to
quote:

I have foreign keys set up from the unique ID key in main database to the foreign keys in each of the separate competitive team tables. The problem is that the ID never transfers when I create a new record in the main database.
Well, the last time I touched Access was about a decade ago, so I can't be of much help there. All I can say is that it sounds like you either need to verify that an actual relationship is set up between the tables (as opposed to just having a field where the foreign key goes), or you need to check the form you have made (that's how Access works, right? You create forms within the program? )

quote:

And I sincerely appreciate the help, even though I might sound retarded.
No problem. And don't feel bad, I probably sound retarded to a real database guy.
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:33 pm to
quote:

you're going to have to write a query that does this...nothing is going to just transfer over. You essentially need like a stored procedure that updates everything on a submit button or something (if I'm reading it correctly)


Yes when a new alumni enters his/her info and selects a team, the submit button needs to then bring up a form or make visible a panel that allows him/her to enter in multiple competitions,details for the selected team.
Then a confirm button will INSERT records(via a query that uses form values) into the appropriate tables.


eta: yea get a book.
This post was edited on 1/17/14 at 1:35 pm
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:34 pm to
quote:


So it's the same design tortious is recommending?


yea. I was just making it a little easy to see so if he has design view of tables pulled up.

It's fun to see DB nerds in here with me. It's only thing I know more about than drinkin/frickin/rugby.
Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:34 pm to
I have a book and a shite ton of videos on database design. Unfortunately it's not very helpful, as you can tell.

Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:35 pm to


Mind if I send you a copy of the db after I make the changes you and tortious suggested? You could probably pinpoint the issue in less than a minute.
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:35 pm to
quote:

I have a book and a shite ton of videos on database design. Unfortunately it's not very helpful, as you can tell.


Well start with the design that we've given you. The form should come after DB design. I know that's a difficult concept unless you're a trained IT nerd. We have engineers here who are brilliant and do it backwards too.
Posted by Tortious
ATX
Member since Nov 2010
5142 posts
Posted on 1/17/14 at 1:36 pm to
Yes miklb is saying the same thing.Then you would use a form where you have the name, team, and competition. You select the appropriate name,team ands competition and submit that to the database. You would have to enter somweone twice of was on more than one team. There are ways to do it once but honestly may be a bit over your head.
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:37 pm to
quote:

Mind if I send you a copy of the db after I make the changes you and tortious suggested? You could probably pinpoint the issue in less than a minute.


Probably not. I'll spend rest of day looking at your shite and doing it for you. for free.

I ain't 13 yrs in the field for nothing.
I gave you a decent framework. Make that shite. then make a form with wizard if you need to.
Posted by Korkstand
Member since Nov 2003
28712 posts
Posted on 1/17/14 at 1:38 pm to
quote:

I have a book and a shite ton of videos on database design. Unfortunately it's not very helpful, as you can tell.

This is a generic 'student athlete' database schema. This site has tons of example schemas for many situations.
Posted by TheOcean
#honeyfriedchicken
Member since Aug 2004
42550 posts
Posted on 1/17/14 at 1:43 pm to
I would have hooked you up with a shipment of some fine CCB brews.

Anyways, bookmark this shite and check it in a couple of days, I'm sure I will have something fricked up
Posted by mikelbr
Baton Rouge
Member since Apr 2008
47538 posts
Posted on 1/17/14 at 1:43 pm to
Anddddd this is why I'm out this thread. I just realized my xref table had AL_ID as PK and Team_ID as FK.

Why didn't anyone catch that? DUHHHHH

Both fields are the PK aka candidate key in that table. it's a many to many relationship(remember cardinality, yall?) with alumni to teams. DOH! on my part.
But I fixed it so both fields are bolded.
I'm out before I take on this shite and don't spend rest of day in Weekend plans thread.
This post was edited on 1/17/14 at 1:45 pm
Posted by Tortious
ATX
Member since Nov 2010
5142 posts
Posted on 1/17/14 at 1:46 pm to
Post an email Ocean and I'll send you a sample that will work or I can reply to you and then you can send me the db and I can fix it.I'll do it later today if brews may be involved.
first pageprev pagePage 3 of 4Next pagelast page

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram