Automatcially Select Specific Child Record

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I am building a golf pool management application and just trying to automate one of the tasks as a record in generated.  For now the pool is comprised of three related tables.  Pool Entrys (the people who join the pool), Tournaments (various golf tournaments) and Event Field (players playing in the tournament).

Keep in mind the plan is that the application will be used simultaneously for more than one Tournament, and will also carry historical data.

I am looking for a method that when someone creates a Pool Entry (parent record), a specific child record from the Tournaments Table is automatically associated with that parent record, kind of like auto filling or specifying a default value in a field but the default value is a specific record from a child table.
Photo of JRogerson

JRogerson

  • 370 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
It sounds like a pool entry can be for many tournaments and a tournament can have many pool entries. Is this correct?
Photo of JRogerson

JRogerson

  • 370 Points 250 badge 2x thumb
Yes, but it is not the relationship that I am having a problem with.  The tournament table contains multiple events.  When someone signs up and creates a pool entry record, I want this pool entry record to select a specific tournament table record automatically, kind of like a default value.
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Any reason you wouldn't have them select the tournament they are interested in when they create an "event field" entry? 

Seems to me like you'd want to have "Contestants (pool entries)" be able to have multiple "Tournament Entries (Event Field)".  Then each "Tournament" also has many "Tournament Entries".  

Then once you create a "Contestant" once, they could enter all the tournaments available. 

Seems like your tournament to entries relationship stated above is backwards.
Additionally, I don't think you should have your contestants related to the tournaments directly.  They will only be joined via the "event field" table.

Just ideas.
Photo of JRogerson

JRogerson

  • 370 Points 250 badge 2x thumb
Sorry, but I always get mixed up as to which record is the child and which record is the parent, so if I have them mixed up, it is my lack of understanding,  And the reason I don't want them to select which event they are registering for, is for simple user input.  The registrant doesn't know the program is being used for multiple events, they are only aware of a single event, that they are signing up for, so having a field that they have to choose their event from a multiple just creates user confusion (in my opinion).

The program is really just for fun, but it is to manage golf tournament pools and we run pools for all of the golf majors over the season.  So in fact the app is only collecting data for one event at at time (this week it will be The Masters), but for multiple events over the course of the golf season.

But I just figured it out and it was as simple as snap.

On my registration table, for the related field to the relationship data I was trying to capture automatically, I just had to set the record number of the data I wanted as the default and BOOM, it grabs it.... 
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Good, I was going to head that direction if you wanted to force select a specific tournament.  

Good to hear you got it, and that your set-up is correct.  Have fun.