Solved

Combo Box for golf tournament database

Posted on 2004-03-31
5
629 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

777 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