Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    16

    Unanswered: Question about Foreign Key

    Hi,
    Very new to DB stuff. I am making a database to track statistics for a hockey team. Wins, losses, individual player stats like goals assists etc. my tables are laid out as follows:

    Table BDIV_teamstats contains:

    Gameday
    Opponent
    Goalsfor
    Goalsagainst
    Win
    Loss
    Tie
    Shutout
    GameID (primary)

    Table BPlayers Contains:

    PlayerID (primary)
    Playername
    Playernumber

    Table BPlayerstats contains:
    StaID (primary)
    staPlayerID (related to Bplayer; PlayerID)
    StaGameid (related to BDIV_teamstats; Gameid
    Stagoals
    Staassists
    Stapoints
    StaPims

    I have created a relationship between these tables as I indicated above. When there is no data in the pages, everythign is fine. As soon as I enter data I get an error:

    "This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables. (Error 3071)"

    Is this because of Primary keys possibly being the same number? I have been told about Foreign Keys? - would doing that help? I really dont know how to create them.

    Using windows Xp Sp2 and access 2003.

    Thanks for reading

  2. #2
    Join Date
    Jan 2003
    Posts
    81
    Do you allow nulls in staPlayerID or StaGameid? Are the data types the same in related fields?

    Also Win, Loss, Tie and Shoutout should be one field (Result) because you can only have one outcome in a game (normalization...)

    Are you tracking only one team? You might need a table with teams in addition. Remember to fill the parent table before the child table.

    Bjorn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •