Solved

Combo Box for golf tournament database

Posted on 2004-03-31
5
631 Views
Last Modified: 2012-05-04
I am running a golf tournament and have set up a database all components are working well.  However I would like to add a little enhancement.  We have 36 teams with 4 players on each team.  Starting Hole table runs a cboStartingHole with a field showing 1A, 1B, 2A, 2B, etc..  When 1 have assigned 4 players (1 team) to a hole I would like that specific hole to not show in the cbo, to prevent accidentally assigning a 5th player (or worse an entire other team)
0
Comment
Question by:ukbusiness
5 Comments
 
LVL 4

Expert Comment

by:AndyAmess
ID: 10725855

what is the sql behind your combo box?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 10725856
you can use

Select Hole From tblHoles where tblHoles.Players < 4
0
 

Author Comment

by:ukbusiness
ID: 10726256
SELECT DISTINCTROW tblStartingHole.* FROM tblStartingHole ORDER BY [tblStartingHole].[StartingHole];
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 10726379
Try this;

SELECT DISTINCTROW tblStartingHole.* FROM tblStartingHole
WHERE ([tblStartingHole].[PlayersField] < 4)
ORDER BY [tblStartingHole].[StartingHole];
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 250 total points
ID: 10726495
This will show you all the holes assigned to players and how many players are assigned to each hole:

SELECT HoleID, Count(PlayerID) AS NumPlayers FROM Holes LEFT JOIN Players ON Holes.HoleID = Players.HoleID GROUP BY Holes.HoleID

To grab all the holes with less then 4 players:

SELECT HoleID FROM (SELECT HoleID, Count(PlayerID) AS NumPlayers FROM Holes LEFT JOIN Players ON Holes.HoleID = Players.HoleID GROUP BY Holes.HoleID) WHERE Nz(NumPlayers,0)<4
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question