Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RULES FOR A LEAGUE

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
help!!! i am writing a pool league system and have these tableS

Game ID
Home Player
Away Player
Week
Home Player result
Away player result
unplayed?

To accompany this I created a table for player information:

Player ID
First name
Surname
Telephone Number
Mobile Number
Paid?

In the TBL GAME I have two fields called, Home Player Result and Away Player Result. When the referee enters the scores in these fields they must both add up to 10. The Home player result added to the Away Player result must equal no more or no less that 10. Therefore scores can be 10-0, 9-1, 6-4 etc. but they add to 10. Can you write me the code to get access to stop data being entered wrongly in this situation.

Secondly, A fixture cannot be entered twice. That is If player 1 is playing player 2 one week they cannot play again another week. What is the code to stop this from happening.

Thirdly In the week field they can only enter from 1-8. every week each player has 2 fixtures, but how can i only allow this to happen and on the last week (week 8) how can i only allow them to have one fixture?

Fourthly, The home player cannot equal the away player. That is each player cannot play themselves. How do i stop the user from entering such values?

Can you write me the code to make these rules happen please. I am begging for your help and it will be much appreciated. If you need any other information please email me back and i will send you the information straight away. If you can answer all of these questions I you would be a life saver. I you can't write the code for all of them then can you please write the code for some

Thankyou, asap
Matt
 
You wrote: In the TBL GAME I have two fields called, Home Player Result and Away Player Result. When the referee enters the scores in these fields they must both add up to 10. The Home player result added to the Away Player result must equal no more or no less that 10. Therefore scores can be 10-0, 9-1, 6-4 etc. but they add to 10. Can you write me the code to get access to stop data being entered wrongly in this situation

Within the table open in design view. Right click on the upper portion of the table and select properties. This will show table properties. In the validation rule for the table write ([HomePlayer]+[AwayPlayer])=10. I don't remeber you may have to write SUM in front. You have now set the validation rule for the table. In the message write a message you would like to show if wrong.

You wrote: Fourthly, The home player cannot equal the away player. That is each player cannot play themselves. How do i stop the user from entering such values?

The previous answer will work for this too. Provided you have only one validation rule at table level.

Looking back at your tables you have a structural issue. You could rather than split as you have have for example one table for results, and a link to home player or away player.

Have a look at normalised data structures in the tables posts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top