Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2007
    Location
    Woodbridge, Virginia, USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Field Value Dependency (2002 SP3)

    I am working on a sports database in which I have a Field lookup to a game result for both the home team and away team (Win, Loss, or Tie). I would like to make it so that the Away_Team_Result field is dependent on the Home_Team_Result field, such that if the home team wins, the away team loses, or vice versa. If the result is a tie for the home team...it should be a tie for both.

    What is the best way to accomplish this in access?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Field Value Dependency (2002 SP3)

    Welcome to Woody's Lounge!

    The way to do this is to leave the Away_Team_Result field out of the table, and to calculate it in a query based on the table. You can then use the query as basis for forms and reports (and for other queries that need the Away_Team_Result).

    If Home_Team_Result is a text field, the definition of the calculated field could be:

    Away_Team_Result: Switch(IsNull([Home_Team_Result]),Null,[Home_Team_Result]="Win","Loss",[Home_Team_Result]="Loss","Win",[Home_Team_Result]="Tie","Tie")

    If it is a number field, use the number values (without quotes) instead of the text values.

  3. #3
    New Lounger
    Join Date
    May 2007
    Location
    Woodbridge, Virginia, USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Field Value Dependency (2002 SP3)

    Thank you for your assistance.

Posting Permissions

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