Stock Description -- Players
1991 Topps #145 -- Frank Thomas/Sammy Sosa/Cal Ripken
My 3 tables are
- tblStockHeader with Stock_ID (auto#), Stock_Description
- tblPlayerHeader with Player_ID (auto#), Player_Name, Player_DOB
- tblStockPlayer with SPlayer_ID (auto#), Stock_ID (long), Player_ID (long)
My goal is to create lines in tables that will normaize the data involving the players as more than 1 can show up in the Excel file for the same Stock_ID. I've gotten that far with no problems so I'm more challenged by there might 2 players named the same thing (think 1960's Frank Thomas and 1990's Frank Thomas) and my Excel files won't know which is which.
So what I'm trying to do is when I import, VBA will dcount the # of Player_Names that match and if it's 0, it'll add the player to tblPlayerHeader and then add the player_id to tblStockPlayer, if it's 1, it'll just add the player_id to tblStockPlayer and if it's 2 or more, it'll open a form of potential matches for me to select which one to then add to the tblStockPlayer.
I truly don't know what direction to go in order to get the form of options to popup and then select/carry back to my original vba process the selected data.
Here is what I have. Please note that GetCSWord(strAString, I) is the broken-out Player_Name from the multiple potentials.
Expand|Select|Wrap|Line Numbers
- For I = 1 To intCnt
- searchcount = DCount("[Player]", "TestPlayerHeader", "[Player_Name] =""" & GetCSWord(strAString, I) & """")
- Select Case searchcount
- Case 0
- MsgBox "Need a new record"
- Case 1
- MsgBox "Only Record"
- Case Is > 1
- DoCmd.OpenForm "TestPlayerHeader", acFormDS, , "[Player_Name] =""" & GetCSWord(strAString, I) & """"
- End Select
- Next