Ok so I am new at access. I am attempting to build a database to track a pool league which will have 3 man teams. Track players, teams, scores and the end goal is to be able to pull player and team statistics via reports. I am going to try to document my database as well as possible before I give details to my issue.
Right now I have 4 tables (relationships attached via jpg image.)
Players table
playerID firstname lastname skill level address city state zip phone email
Teams Table
Team ID Team Name
Team Lineups Table
TeamNumber P1_ID P2_ID P3_ID
Match Table
week player team wins losses break and run
I have a simple form to add a name team where I get a teamID and team name in my teams table
I have another simple form to add a player's info into the players table
I have a 3'rd form that is a bit more complicated, using comboboxes and text boxes I am able to get the players lineup table populated. Basically each team has 3 players so I want to track what player is on what team. so the team lineups table has the Team_Number + player 1 ID player 2 ID and player 3 ID.
I have 4 combo boxes, I didn't change the names so it's a bit confusing (see team lineups form.jpg)
combo13 = team name
combo34 = player 1
combo 39 = player 2
combo43 = player 3
Now the combo boxes use a row source of a query of the players table. SQL view
SELECT Players.[First Name], Players.[Last Name], Players.Player_ID
FROM Players
ORDER BY Players.Player_ID;
I get the first name and last name of the player in the combo box list. I then have a little VB to push updates to the text boxes so I can actually use the text box control source to update my team lineups table.
Private Sub Combo13_AfterUpdate()
Me!Text11 = Me!Combo13.Column(0)
End Sub
Private Sub Combo34_AfterUpdate()
Me!Text28 = Me!Combo34.Column(2)
End Sub
Private Sub Combo39_AfterUpdate()
Me!Text37 = Me!Combo39.Column(2)
End Sub
Private Sub Combo43_AfterUpdate()
Me!Text41 = Me!Combo43.Column(2)
End Sub
Ok so everything up to this point is working just fine. What I need now is a form to enter in the weekly match information. (see weekly team scores.jgp) This is where I am having issues and am not sure where how to do it.
I have a combobox list for the week. 1-13 manually entered values..no biggie.
Now, here is what I need. I need to be able to select the team name from the combo box, autofill the player1 -3 firstname/lastname in the player1-3 fields and also fill the playerID fields. Then I can enter in their wins/losses and break and runs. I thought I could get the info somehow by using the team lineup table since I would know the teamID and playerIDs for each player on the team but I can't figure out how.
and
If I can get all of this info filled out I really don't know how to get the button to add these records. since there should be 3 records added to the Match table, one for each player, when the button is clicked. I think the default add record event on the button only adds 1 record..but in this case..there would be 3 that needs to be added.
Any and all help is highly apprieciated.
Tony
Right now I have 4 tables (relationships attached via jpg image.)
Players table
playerID firstname lastname skill level address city state zip phone email
Teams Table
Team ID Team Name
Team Lineups Table
TeamNumber P1_ID P2_ID P3_ID
Match Table
week player team wins losses break and run
I have a simple form to add a name team where I get a teamID and team name in my teams table
I have another simple form to add a player's info into the players table
I have a 3'rd form that is a bit more complicated, using comboboxes and text boxes I am able to get the players lineup table populated. Basically each team has 3 players so I want to track what player is on what team. so the team lineups table has the Team_Number + player 1 ID player 2 ID and player 3 ID.
I have 4 combo boxes, I didn't change the names so it's a bit confusing (see team lineups form.jpg)
combo13 = team name
combo34 = player 1
combo 39 = player 2
combo43 = player 3
Now the combo boxes use a row source of a query of the players table. SQL view
SELECT Players.[First Name], Players.[Last Name], Players.Player_ID
FROM Players
ORDER BY Players.Player_ID;
I get the first name and last name of the player in the combo box list. I then have a little VB to push updates to the text boxes so I can actually use the text box control source to update my team lineups table.
Private Sub Combo13_AfterUpdate()
Me!Text11 = Me!Combo13.Column(0)
End Sub
Private Sub Combo34_AfterUpdate()
Me!Text28 = Me!Combo34.Column(2)
End Sub
Private Sub Combo39_AfterUpdate()
Me!Text37 = Me!Combo39.Column(2)
End Sub
Private Sub Combo43_AfterUpdate()
Me!Text41 = Me!Combo43.Column(2)
End Sub
Ok so everything up to this point is working just fine. What I need now is a form to enter in the weekly match information. (see weekly team scores.jgp) This is where I am having issues and am not sure where how to do it.
I have a combobox list for the week. 1-13 manually entered values..no biggie.
Now, here is what I need. I need to be able to select the team name from the combo box, autofill the player1 -3 firstname/lastname in the player1-3 fields and also fill the playerID fields. Then I can enter in their wins/losses and break and runs. I thought I could get the info somehow by using the team lineup table since I would know the teamID and playerIDs for each player on the team but I can't figure out how.
and
If I can get all of this info filled out I really don't know how to get the button to add these records. since there should be 3 records added to the Match table, one for each player, when the button is clicked. I think the default add record event on the button only adds 1 record..but in this case..there would be 3 that needs to be added.
Any and all help is highly apprieciated.
Tony