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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Soccer Team Database

Status
Not open for further replies.

Chris121

Technical User
Aug 18, 2003
34
0
0
GB
Hi
I have a query showing all players who attend particular traing sessions. The query is taken from a table where each player has a field of their own, and I can make it work with a query for each player.

What I want to do instead, is have the query ask for a player name with a combo box then run for that player, so just one query will get the job done.
1. Is this possible?
2. Where do I start?

Thanks,

Christine.
 
Each player has their own field or own record? If they each have their own record then it's a simple enough parameter query that asks for the information that identifies each player (such as the player's name).

I'm not sure if I can help you, but you've intrigued me now. What does your table look like?

"I think there is a world market for maybe five computers." -Thomas Watson, chairman of IBM
 
The players table I have has:-
playerID (primary key)(autonumber)
Squad No. (number)
Firstname (text)
Lastname (text)

And

Training session Table:-
SessionID (autonumber)
Date (shortdate)
Coach (Text)
Warmup Type (Text)
Warmup Time (Short Time)
Session Type (Text)
Session Time (Short time)
PlayerID1 yes/no (Caption = Joe Soap)
PlayerID2 yes/no (Caption = Bert Smith)
PlayerID3 yes/no (Caption = Fred Bloggs)
(There are 25 to be entered, but I thought it best just to do 3 for now ,until it all works ok.

The entry form for the Training session table was simple enough to create now, and as I wanted, we have a checkbox for the yes/no on each of the 3 players entered. I've entered 3 sample records and the table seems to be updated correctly.

The query works fine, but I can select each player separately, only if I do a separate query for each player. Ideally, I want a single query which asks for the player name (like a parameter query) and runs with the selected player’s field only.

Cheers
Christine.
 
Since you are going to have multiple players for each training session, you need to normalize your database by creating a third table (Player_Sessions with PlayerID and TrainingSessionID as the primary key - which allows the same player to partake of more than one Training Session).

See Thread700-628486

and search the forum/web for Normalization. For future reference when you start adding fields like Player1, Player2, etc., that is a sure sign the database is not normalized.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top