Results 1 to 10 of 10
  1. #1
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73

    How to assign PK for two 2 tables in a RDBM?

    Quote Database
    Narrative
    For my research I need a Quote Database to storage Quotes form three references sources. Quotes can be collected from Reference Types such as Scientific Papers, PhD Thesis and MSc Thesis.

    Reference information includes: Year (Number), Author (String), Title (String), ReferenceType (Text), Vol (String), Issue (String), Pages (Number), AccNumEN (Number).

    ReferenceType information includes: MSc Thesis, PhD Thesis and, Scientific Paper.

    Author information includes: Author Name (String).

    Quote information includes: Quote (Memo)



    I think the Entities are: Author, Reference, ReferenceType, Quote, and Keyword.
    Having in mind the Entities, the relationships I already identified are:

    An Author can have many References
    A Reference can have many Authors

    A Reference can have one ReferenceType
    A ReferenceType can have many References

    A Reference can have many Quotes
    A Quote can have one Reference

    A Quote can have many Keywords
    A Keyword can have many Quotes

    A Reference can have many Keywords
    A Keyword can have many References

    AccNumEN is the ID field in EndNote program for each Reference

    PK for Refrence Type can be 1 for MSc Thesis, 2 for PhD Thesis and 3 for Scientific Paper
    I don’t know how to assign PK to Author and PK to Reference.

    Any light on this would be really appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Consider tables:

    tblAuthors
    AuthID (PK)
    LastName
    FirstName
    DOB
    Gender

    tblReferences
    RefID (PK)
    RefType
    RefTitle
    PubDate
    Volume
    Issue
    Pages
    AccNumEN

    tblRefAuthors
    RefID (FK)
    AuthID (FK)

    tblQuotes
    QuoteID (PK)
    RefID (FK)
    Page

    Can have a lookup table for the reference types or can manually build the list in combobox RowSource property.

    The real complication here is how to handle the keywords. Options:

    1. just a string of comma delimited characters in a text field
    2. multi-value field
    3. single table - I think only if the same keywords are used for reference and its related quotes
    4. two tables - one for each tblReferences and tblQuotes
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    I see these tables:
    tAuthors
    tAuthorRefs
    tReferences
    tRefQuotes

    tQuotes

    tRefTypes
    ----------
    Quotes can be collected from Reference Types
    3 Scientific Papers,
    2 PhD Thesis
    1 MSc Thesis.

    Keywords table (useless)
    (is this needed? Cant you search all words in the Reference or quote?)

  4. #4
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73
    Hello June7
    I will try with the 4 tables you recommend. Still I don't know how to assign PK for Authors and References Tables. First I will try with Autonumber
    I am planning to query Quotes in a Form with a Textbox entering a Keyword. MS Access will display Quotes in a Form with a Listbox. When User clicks a line the Reference will be displayed in a Label. When user double clicks a line the Reference (.pdf) paper will be displayed. I know how to do these two steps.
    I keep you inform.
    Many thanks

  5. #5
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73
    Hello ranman256
    I think I need the Keywords table to Query Quotes in the References Table.
    As I said to June7, I don't know how to assign Authors PK (canbe autonumbering?).
    I let you know what I am doing with your help and June7 help.
    Many thanks

  6. #6
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73
    Hello June7 and ranman and Forum
    Access 2010 in Spanish
    I'm have been spending long hours designin my Quote Relational Database. In addition, I dont know how to include CoAuthors in the Database.
    I have a Form to search Quotes using Keywords. However, with any Keyword, the Query returns all Quotes.
    I attach the Quote_Test1 DB as example where I have to References (Scientific Paper and PhD Thesis).
    I am looking a Query returnins fields:
    Year-Author(s)-Titlte-RefType-Vol-Issue-AccNumEN-Quote(s)


    June7. Please Could you explain me the meaning of DOB


    Thank you very much. Each assistance is appreciated.
    Attached Files Attached Files

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    DOB - date of birth

    For co-authors - that's what my suggested tblRefAuthors is for. Multiple authors would be mean multiple records for each Reference.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73
    Hello. Many thanks for quick reply.
    According to this Forum recommendations (I hope I understood) I already redesigned Database. I attached DB example.
    However, when I enter a Keyword Query returns always 8 Quotes (already Total of Quotes). I need a Query to returns only Quotes related to Keyword. Any help is really appreciated.
    My SQL is
    SELECT tblReferences.PubDate, tblReferences.RefTitle, tblReferences.RefType, tblReferences.Volume, tblReferences.Issue, tblReferences.Pages, tblReferences.AccNumEN, tblKeywords.Keyword
    FROM (tblReferences INNER JOIN (tblQuotes INNER JOIN (tblKeywords INNER JOIN tblKwQteRef ON tblKeywords.KwID = tblKwQteRef.KwID) ON tblQuotes.QuoteID = tblKwQteRef.QuoteID) ON tblReferences.RefID = tblKwQteRef.RefID) INNER JOIN (tblAuthors INNER JOIN tblRefAuthors ON tblAuthors.AuthorID = tblRefAuthors.AuthID) ON tblReferences.RefID = tblRefAuthors.RefID
    WHERE (((tblKeywords.Keyword) Like [Forms]![Frm_Search].[Q_01_Kw_Qte] & "*"));
    Note. In my SQL code [Forms] is written as [Formularios]
    I can´t access to Authors's DBO. This field by the moment is useless in my DB.

    Please Help

    Cheer'
    Attached Files Attached Files

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    The DOB field was only an example of data that could be associated with author. Retain whatever is of value to you.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    seb is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    73
    June7. Many thanks againg. I am thinking how to link DOB to CoAuthors.
    I searched through the Access Forums and couldn't quite find what I was looking for my Db design.
    Please let me know of any comments and/or suggestions you may have to facilitate the making of my Db design.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. You can't assign a value to this object error
    By bdicarlo1 in forum Forms
    Replies: 6
    Last Post: 11-18-2012, 10:21 AM
  2. You can't assign a value to this object
    By boywonder in forum Programming
    Replies: 1
    Last Post: 09-08-2011, 04:54 PM
  3. How to assign criteria for Yes/No?
    By AccessThis in forum Queries
    Replies: 1
    Last Post: 07-20-2010, 03:51 PM
  4. Replies: 2
    Last Post: 03-27-2010, 10:52 AM
  5. assign value from list
    By roman.pro in forum Forms
    Replies: 0
    Last Post: 05-16-2009, 04:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums