I have created a database for a senior softball league.
I have a main form and subform which is working great to display players on team by year and season (e.g., 2008 Fall).
The main form is based on a query.
The main form has a combobox based on a table to select the year and season. Then, another combobox based on the same query as the main form to select the players in that year and season. The subform displays the team(s) the selected player was on.
My problem is ... a player can play on more than one team during a season (on different days). I want the record count on the main form to count a player once. If I change Unique Values to Yes in the main form's query, my main form is blank when I open it. I have Unique Values set to Yes in the combobox but that doesn't affect the record count.
I'm probably missing something very obvious but I'm not seeing it.
I hope this makes sense.
Thanks in advance for any help,
Debbie
I have a main form and subform which is working great to display players on team by year and season (e.g., 2008 Fall).
The main form is based on a query.
Code:
SELECT Members.MemNum, Members.LN, Members.FN, Members.Nickname, Members.Suffix, Members.Gender, Members.BirthDate, Members.Died, Teams.TeamYear, Teams.TeamSeason
FROM Teams INNER JOIN (Members INNER JOIN Players ON Members.MemNum = Players.MemNum) ON Teams.TeamNum = Players.TeamNum
WHERE (((Members.Died) Is Null) AND ((Teams.TeamYear)=[forms]![frmPlayers&Teams]![GetYear]) AND ((Teams.TeamSeason)=[forms]![frmPlayers&Teams]![GetSeason]))
ORDER BY Members.LN, Members.FN;
The main form has a combobox based on a table to select the year and season. Then, another combobox based on the same query as the main form to select the players in that year and season. The subform displays the team(s) the selected player was on.
Code:
SELECT Players.MemNum, Players.TeamNum, Teams.NightPlayed, Teams.TeamName, IIf(IsNull([Nickname])=True,[FN],[Nickname]) & " " & [LN] AS ManagerName, Teams.TeamYear, Teams.TeamSeason
FROM (Members INNER JOIN Teams ON Members.MemNum = Teams.ManagerMemNum) INNER JOIN Players ON Teams.TeamNum = Players.TeamNum
WHERE (((Teams.TeamYear)=[forms]![frmPlayers&Teams]![GetYear]) AND ((Teams.TeamSeason)=[forms]![frmPlayers&Teams]![GetSeason]))
ORDER BY Teams.NightPlayed, Teams.TeamYear DESC , Teams.TeamSeason;
My problem is ... a player can play on more than one team during a season (on different days). I want the record count on the main form to count a player once. If I change Unique Values to Yes in the main form's query, my main form is blank when I open it. I have Unique Values set to Yes in the combobox but that doesn't affect the record count.
I'm probably missing something very obvious but I'm not seeing it.
I hope this makes sense.
Thanks in advance for any help,
Debbie