Results 1 to 10 of 10
  1. #1
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100

    Question No Lookups in a Table

    I have seen the light and no longer use Lookups in tables. However, this brings up an issue only solved by experience of which I have very little.

    I have a table representing four different situations on each of 25 different occurrences. Each of these 100 alternatives consists of a symbol and a location (that’s right (200 fields + 2 ID fields). The location is an integer (1-9) and the symbol is one of 35 text options. It is my goal to eliminate typos on data entry by creating a relationship between a table holding symbols and a table with the occurrence fields for use on a data entry form. Therein lies the rub.

    As you can see on the screen capture of my relationships, I’ve created a table holding the 35 symbol options (tblSymbols). A much larger table holds the 100 alternatives (tblPlayersHitting). When I started creating the relationships between tblPlayersHitting and tblSymbols, Access created “pseudotables” called tblSymbol_1, tblSymbol_2, tblSymbol_3, etc. I call them pseudotables (I don’t know the correct term) as they exist in the relationships but not as actual tables listed with the other tables.



    My specific question is “Is this the appropriate and best approach?” Clearly, the relationship window will be very cluttered should I go ahead and add the other relationships for all the symbols on all the occurrences. To throw fuel on the fire, the db will eventually have a “tblPlayersPitching” with the same number of relationships with tblSymbols as tblPlayersHitting.
    Last edited by oleBucky; 03-08-2011 at 05:03 PM. Reason: Missing words make for marginal replies.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You do *not* want more than one table to have the same PrimaryKey. You can put the Primarykey in another table as a ForeignKey but that 2nd table will have its own PrimaryKey.

  3. #3
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100
    Thanks for the heads-up. I would have gone on blissfully until something detonated! I think I fixed the Key Field issue in tblPlayersHitting and the tblRateImport is a temporary table I used with an update query. I am assuming when I get rid of that table, the duplicate Primary Key will go away.

    Is it necessary to have a Key Field in a Junction Table?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by oleBucky View Post
    Is it necessary to have a Key Field in a Junction Table?
    The simple answer is NO since it already contains two PrimaryKeys.

  5. #5
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100
    Also, what is a best practices policy regarding data type for Primary Keys? I think if you let Access defaults play, Access uses AutoNumber as a long integer. This presents a problem on enforcing referential integrity in relationships due to different data types if, like I have, the user defines their own primary key as a Number data type, not an AutoNumber.

  6. #6
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100
    Come on guy. Throw me a bone here!

    I'm a newbie and am simply looking for some general advise on db design. I am not looking for detailed solutions, simply directional guidance from those more experienced than I.

    How best do I go about tackling the problems as noted in the original post? I will in no way be offended if what I am doing is dumb and someone tells me so.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Typically *you* would define the tables and their structure including Primary and Foreign Keys. I am not in favor of letting a user do that without them also having a complete copy of Access and defining the rest of the system as well. Sorry.

  9. #9
    oleBucky's Avatar
    oleBucky is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2011
    Location
    Inside the Loop
    Posts
    100
    Quote Originally Posted by RuralGuy View Post
    I am not in favor of letting a user do that without them also having a complete copy of Access and defining the rest of the system as well.
    Might you expound on your statement. Specifically, what is a complete copy of Access (versus an incomplete copy) and what do you mean by "defining the rest of the system"?

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by oleBucky View Post
    Might you expound on your statement. Specifically, what is a complete copy of Access (versus an incomplete copy) and what do you mean by "defining the rest of the system"?
    Basically what I am saying is a developer defines what you are describing and not the end user. It is *your* system after all so you can let the end user do anything you want them to do. Enjoy.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-01-2010, 01:12 PM
  2. lookups and data selection help
    By benjammin in forum Access
    Replies: 3
    Last Post: 11-28-2010, 04:45 PM
  3. Access ADP & Lookups
    By sql_dan in forum Access
    Replies: 0
    Last Post: 06-09-2010, 04:25 AM
  4. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

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