Not Make Visible on Form (1 Viewer)

Rayhogan

Registered User.
Local time
Today, 01:29
Joined
May 8, 2011
Messages
16
Hi all,

Have been away from Access for nearly 2 decades and hence need a little help.

I have a Form for recording Golf Scores (local Society) and would like add option to enable just to record Holes 1 to 9, Holes 1 to 15 or all 18 Holes. Therefore, I just need for each competition (session) to not make Not Visible 10 to 18 (txtScrHole10 to txtScrHole18) or 16 to 18.

Please do excuse if this posting is inappropriate or otherwise.

Thanking you in anticipation

Ray Hogan
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:29
Joined
Oct 29, 2018
Messages
21,454
Hi Ray. One way I might consider doing this is by using a Tab Control with three pages. As the form opens, I will only display one of the tabs depending on which holes need to be filled out. Just a thought...
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 17:29
Joined
Jan 10, 2011
Messages
904
Just as a thought, you might look at the NCGA web site. www.ncga.org and see how they have it set up. You can post the 18 hole score, each nine hole score separately or only nine holes, front or back. Go to "Post a Score" under the Handicap tab. Pretty easy to figure out what they are doing.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:29
Joined
May 21, 2018
Messages
8,525
Lets say you have some way to select coursetype and it returns values, 9, 15, 18. Maybe that is a combobox or some variable. You can tag the controls for 10-15, and 16-18. 1 to 9 are always visible so does not matter

'Assuming you are not using the tag fields for other things
Code:
dim ctrl as access.control
for each ctrl in me.controls
  if ctrl.tag <> ""
     ctr.visible =  (cint(ctrl.tag) <= coursetype)
  end if   
next ctrl
If you pick a course type of 15 then it loops the controls on the form. if a control is tagged 10,11,15 then it will become visible and anything else will be
 

Isaac

Lifelong Learner
Local time
Yesterday, 17:29
Joined
Mar 14, 2017
Messages
8,777
Hi all,

Have been away from Access for nearly 2 decades and hence need a little help.

I have a Form for recording Golf Scores (local Society) and would like add option to enable just to record Holes 1 to 9, Holes 1 to 15 or all 18 Holes. Therefore, I just need for each competition (session) to not make Not Visible 10 to 18 (txtScrHole10 to txtScrHole18) or 16 to 18.

Please do excuse if this posting is inappropriate or otherwise.

Thanking you in anticipation

Ray Hogan
What's your current set up? Textboxes, comboboxes, radio buttons?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:29
Joined
May 7, 2009
Messages
19,229
and what is the Form type (single, continuous, datasheet).
you can Hide controls in single/continuous.
you can Hide Columns in datasheet.
 

Rayhogan

Registered User.
Local time
Today, 01:29
Joined
May 8, 2011
Messages
16
Just as a thought, you might look at the NCGA web site. www.ncga.org and see how they have it set up. You can post the 18 hole score, each nine hole score separately or only nine holes, front or back. Go to "Post a Score" under the Handicap tab. Pretty easy to figure out what they are doing.
Eljefegeneo,
Thanking you, but I live in Ireland
 

Rayhogan

Registered User.
Local time
Today, 01:29
Joined
May 8, 2011
Messages
16
What's your current set up? Textboxes, comboboxes, radio buttons?
Isaac
Thanking you.
Simple Texrbox as per attached with Holes 16, 17 & 18 hidden.
 

Attachments

  • ScoreCard.JPG
    ScoreCard.JPG
    54.6 KB · Views: 142

Rayhogan

Registered User.
Local time
Today, 01:29
Joined
May 8, 2011
Messages
16
and what is the Form type (single, continuous, datasheet).
you can Hide controls in single/continuous.
you can Hide Columns in datasheet.
arnelgp.
Thanking You.
Its a simple continous Form type as per attached
 

Attachments

  • ScoreCard.JPG
    ScoreCard.JPG
    54.6 KB · Views: 91

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:29
Joined
May 21, 2018
Messages
8,525
You say it is a continous form, but since you have two columns I am guessing it is not unless each column is a subform, which I doubt.
However, this raises another issue on how your table is structure. In fact it should be a continous form which will be initially harder to make, but will allow summing scores and other data manipulation so much easier.

I am guessing your table is something like
PersonID_FK ' a foreignkey to the person
CourseID_FK 'key to the course
Hole1Score
Hole2Score
Hole....18Score

Where it should be more like ( a record for each score not a field)
PersonID_FK
HolesPlayed
HoleNumber
Score


Then when you create a new score card it only creates a record for the correct amount of holes depending on the amount played. Then in truth it is a continous form and nothing hidden. You only have a record for the correct amount of holes.

Any chance you can show your table structure? You can drop into the relationship window and show a screen shot.
As said, this will seem initially harder to make it properly normalized, but will simplify things in the long run.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:29
Joined
May 7, 2009
Messages
19,229
see this sample
 

Attachments

  • holes.accdb
    524 KB · Views: 145

Rayhogan

Registered User.
Local time
Today, 01:29
Joined
May 8, 2011
Messages
16
You say it is a continous form, but since you have two columns I am guessing it is not unless each column is a subform, which I doubt.
However, this raises another issue on how your table is structure. In fact it should be a continous form which will be initially harder to make, but will allow summing scores and other data manipulation so much easier.

I am guessing your table is something like
PersonID_FK ' a foreignkey to the person
CourseID_FK 'key to the course
Hole1Score
Hole2Score
Hole....18Score

Where it should be more like ( a record for each score not a field)
PersonID_FK
HolesPlayed
HoleNumber
Score


Then when you create a new score card it only creates a record for the correct amount of holes depending on the amount played. Then in truth it is a continous form and nothing hidden. You only have a record for the correct amount of holes.

Any chance you can show your table structure? You can drop into the relationship window and show a screen shot.
As said, this will seem initially harder to make it properly normalized, but will simplify things in the long run.
Yes Majp – you have guessed correctly, and I must admit to a beginners’ error, but now we are where we are, some 2 decades later and as you can see from the relationship – I prefer the physical records as we would only have less than 1k records each year (Seniors Group of about 30 participants)

Without going into the details of the requirements of the program – it is required to records a score for at hole for each competitor, calculate a points value based on a handicap value from which a results report is produced. In our society, we have an additional value of credits and deductions to affect a distribution of balance between competitors over the year.

With respect to the Form - column Points is a calculated value based on the above, hence the Score column is connected to tblScores and each field is default to 0.

Hope this makes sense.

Thanking you
 

Attachments

  • Tables.JPG
    Tables.JPG
    76.3 KB · Views: 140

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 20:29
Joined
May 21, 2018
Messages
8,525
but now we are where we are, some 2 decades later and as you can see from the relationship – I prefer the physical records as we would only have less than 1k records each year (Seniors Group of about 30 participants)
You have to weigh the efforts to fix vs deal with it. At this point it may be just too much work. It is kind of a Catch 22. If you normalize this (each score is a record) correctly, then building a friendly UI becomes more difficult. If you do it like you have, then the form is easy, but any data manipulation is much harder. If it was normalized calculating user total score, above/below par, avg per course, avg per hole, avg user score per course, etc etc, .... would be trivial. With this design to do a basic sum for the course requires VBA to sum multiple fields. So every calculation will require a hack or at least a normalizing union query. With that said a normalizing query will be your friend. I bet if this was normalized from the beginning it would have saved a lot of work. I imagine there are some significant workarounds to do some basic things.
 

Eljefegeneo

Still trying to learn
Local time
Yesterday, 17:29
Joined
Jan 10, 2011
Messages
904
Eljefegeneo,
Thanking you, but I live in Ireland
I heard that your guys are still prevented from going out and social distancing on the golf course. Too bad. We've been our on the course since the middle of last year.

When I suggested that you look at the page, if you can bring it up, you can see the NCGA posting page and thus be able to figure out what they are doing. For example, if you select only nine holes, only nine holes will show, etc. The GHIN or member numbers are seven digits. Anyway, it was only a suggestion. If you are still stuck, let me know and I will try to emulate their database for you. should not be very hard.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:29
Joined
Feb 19, 2002
Messages
43,233
I'm going to post an example which may be over your head but it allows you to normalize the data which makes analyses easier but gives you a way to create a bound form that looks like a spreadsheet so you would end up with 1 row per player with 9-18 columns for holes. There are two examples. One works with months and the other with expenses.

If you stick with your current layout, you can solve the display problem by adding two solid boxes to the form that cover holes 1-15 and 16-18. Depending on what you want the form to show, you bring one or both to the front in the form's current event and that effectively hides what you don't want to see.
 

Attachments

  • BoundDenormalizedForm_20210319.zip
    1.5 MB · Views: 110

Users who are viewing this thread

Top Bottom