Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combo Box for golf tournament database

Posted on 2004-03-31
5
Medium Priority
?
646 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 51

Accepted Solution

by:
Steve Bink earned 1000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 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