Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Golf Scores
Dan Dewey 
    
5 years ago
I am trying to count the number of birdies a golfer has scored. I created a table (BirdieT) with 18 fields, Hole 1 thru Hole 18.  I now want to create a form showing these fields, but I want to add one more field - total count - to show the number of birdies this golfer has made. Do I need to create a query to do this or can I do this in the form? If so, how do I set this up?  Thanks
Adam Schwanz  @Reply  
           
5 years ago
I'm assuming you have a field for strokes and a field for par?
You could just do make a textbox on your form and use DCount
=DCount("IDField","BirdieT","Strokes=Par-1 and GolferID=" & [GolferID])
Adam Schwanz  @Reply  
           
5 years ago
Alternatively, if you're showing all 18 holes at once on a continuous form, you can just use the SUM feature in the form footer. Calculated Fields
Richard Rost  @Reply  
          
5 years ago
Yeah, I'd go with what Adam said. Why track just birdies when you can track their actual score for each hole and calculate the birdies?

GolfScoreT
ID, GolferID, HoleID, Par, Score
1, 1, 1, 5, 5 ' shot par
2, 1, 2, 3, 4 ' bogie
3, 1, 3, 4, 3 ' birdie


Then you could even name them in a query:

X: IIF(Score=Par, "Par", IIF(Score=Par-1, "Birdie", IIF(Score=Par+1, "Bogie", IIF(Score

Then if you want to count birdies, just COUNT() the number times "Birdie" appears.

Richard Rost  @Reply  
          
5 years ago
This might make a cool little database. I know someone else recently asked me about tracking golf scores.... where'd that email go....???
Dan Dewey OP  @Reply  
    
5 years ago
Thanks for your quick response.  What I am attempting to do is just track, at this time, birdies for our league Birdie Pool, and the Ringer Pool as well.  The Ringer Pool has a whole different set of problems.  So, all I want to do for now is count the birdies each player has made.  I have created a BirdieT with fields BirdieID, GolferID, and Hole1 thru Hole 18.  Then I created a BirdiePoolAQ (this is because we have two divisions in the Birdie Pool, "A" & "B") which brings together my GolferT and BirdieT information.  The BirdiePoolA Query works just fine.  However, I am confused as to how to create a count function to count each player's birdies.  So I created a form using the BirdiePoolA Query which also works just fine.  But I can't get the DCount function to work.  I brought in a text box, like you suggested entering =DCount("hole1","hole2", etc.)  When I open the form that field returns an "ERROR".   So, I'm obviously not doing this correctly.  Can you help me?
Richard Rost  @Reply  
          
5 years ago
Post a screen shot of your data.
Dan Dewey OP  @Reply  
    
5 years ago
Name/Hole    1         2      3       4      5        6      7      8     9     10    11    12     13    14    15   16    17    18   TOTAL  Latest Date
ABC Golfer  06/04  7/20  4/16  4/16  5/11  6/24  4/16 6/29 5/25                5/27 5/11 7/23   5/6  

I couldn't load a screen of my data so here is the first line showing in the query.  This golfer has 13 birdies with the last birdie being posted on 7/23.  I'm looking to COUNT the birdies and post the latest date.  Any direction you can give me would be appreciated.
Adam Schwanz  @Reply  
           
5 years ago
I'm having a hard time following where you're getting your par/birdie information with a layout like that. I suspect that may be part of your problem is the way the data is stored.

I would do
ID
GolferID
HoleID
Date
Par
Strokes
Division
and maybe a session ID if you play over multiple days

You can just DMAX the date to see when the most recent date was. DMax

If you have your holes setup as 18 different fields instead of one, your going to have to count/dcount every one of them if you want the total number of birdies ever for a golfer. Then add all 18 of those togethor.
Richard Rost  @Reply  
          
5 years ago
The problem here is the way you have your table setup. You've got actual fields called Hole1, Hole2, Hole3, etc. which is going to make your functions a mess. Counting them is easy:

xCount: IIf(IsNull([Hole1]),0,1)+IIf(IsNull([Hole2]),0,1)+IIf(IsNull([Hole3]),0,1)

There's how you would do it for 3 holes. Copy and paste for the rest. Finding the most recent date is going to be a nightmare, and I don't think you can do it with a simple query. You'd need to write a custom function, send all 18 values, and then loop through them to find the highest one.

A better solution would be to rebuild the table in a more data-friendly design. I would do:

GolferID
BirdieHoleNumber
BirdieHoleDate


Now you've got data that looks like this:

1, 5, #4/1/2021#
2, 8, #5/3/2021#
5, 4, #6/1/2021#


This says "golfer 1 got a birdie on hole 5 on 4/1/21," "golfer 2 got a birdie on hole 8 on 5/3/21," etc.

NOW you can use a simple DCOUNT and DMAX to find what you need.
Richard Rost  @Reply  
          
5 years ago
Try not to set up a table with Field1, Field2, Field3, etc. Like PhoneNumber1, PhoneNumber2, PhoneNumber3, or Address1, Address2, Address3. Poor design, and it leads to problems like this.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 7:16:11 AM. PLT: 0s