Pls help, useless Access person here!

Celtic Queen

Registered User.
Local time
Today, 19:21
Joined
Feb 26, 2003
Messages
29
Hiya, I'm making a library system as a school project.I have two tables, called books and publishers.There is a column of data on the book table called 'publisher', which has identical data to a column on the publishers table called 'names'.These 2 entities are linked
I also have forms of these tables.On the 'item' form I want the user to be able to click on a button next to the 'publisher' entity and be presented with that publisher's details on the Publisher form.
I don't know if this is a query or what
Pleeease help xxx
 
You shouldn't be using the publisher's name as your foreign key. In both tables you should have a field that is typed autonumber that serves as your primary key, something like this:

tblPublishers
autoPublisherKey = autonumber (PK)
txtPublisherName = text

tblBooks
autoBookKey = autonumber (PK)
lngPublisherID = long integer (FK to tblPublishers.autoPublisherKey)
txtBookISBN = text
dtmBookDatePublished = short date


etc., etc. In the relationships window, create a one-to-many from tblPublishers.autoPublisherKey to tblBooks.lngPublisherID.

There are a ton of free resources on the web to help you learn about Access and about database design, and this forum is one of the very best. However, folks here will expect you to do your homework and not simply keep posting question after question asking them to basically do it for you.

Your first step should always be to search Access help. #2 should be to search the arhives here--somone else has almost certainly asked a similar question before. Examine the included Northwind Traders database carefully. Then post your question here.

Getting back to your post, once you have your tables set up correctly, the button wizard in the design view should walk you through creating your "Publisher" button.

--Expectant Mac
 
if you create a command button using the wizard to open your publisher form, you can tell it to use the publisher name as the link criteria...and it generates the code for you
 
That's true, but there are all sorts of other reasons not to use the name as PK.

--Multipurpose Mac
 
So does that mean I'll have 2 start the tables all over again? :(
NEway thanx every1 (apart from the 1st person who answered = so mean!
 
Not sure what I said that was "so mean", but...

As to whether or not you have to start the tables all over again, that depends. Fields can be added to the existing design fairly easily. Add the autonum field to tblPublishers, refresh the records, then go back and set that as PK. Then un-set the names column (so it's no longer PK). Same with tblBooks, plus add the lngPublisherID field set to long int. Delete the existing relationship and create the new one. Last, go back and delete the original, unneeded "publisher" field from tblBooks.

--So-Mean Mac



Y UZ CHTSPK? I 4 1 H8 IT.
 
Last edited:
I'm guessing: Chat Speak.

He's referring to this 'sentence' by yourself: "NEway thanx every1"

i.e. Why use that when proper English is so much easier to read?
 
Apologies

CQ - Don't let my crankiness ward you off from these forums. They are an amazing resource and everyone here is generally more than happy to help out newbies. There has been a recent rash of students, however, that have basically been asking the folks here to do their assignments for them, and it's made me a bit spikey. Apologies to you if I said anything "mean", it wasn't meant that way.

If you care to, zip up your file and send it to me via private e-mail and I'll fix those tables for you.

--Too-Hasty Mac

BTW, Mile-O-Phile, love the latest avatar.
 
Last edited:
aww

That is such a sweet thing 2 offer!
U're so right, I am a student with a really crap IT teacher, and I do come on here expecting u ppl 2 do my H/W 4 me (shame on me)
I'm very sorry
xxxxxxxxxxxxx
 

Users who are viewing this thread

Back
Top Bottom