Sub Game_Score(gameUID As Long, vRuns As Integer, hRuns As Integer) Dim rsQuery As ADODB.Recordset Dim rsQuery2 As ADODB.Recordset Dim sql As String Dim tempGame As gameRecord Dim i As Integer, j As Integer vRuns = 0 hRuns = 0 Game_GetScoreInformation gameUID, tempGame ' first check the live entry events Set rsQuery = New ADODB.Recordset sql = "select * from events where gameuid = " + Format(gameUID) + " and finalBase = 4" rsQuery.Open sql, dbConnection, adOpenForwardOnly, , adCmdText If Not rsQuery.EOF Then rsQuery.MoveFirst While Not rsQuery.EOF If rsQuery("inninghalf") = 0 Then vRuns = vRuns + 1 Else hRuns = hRuns + 1 End If rsQuery.MoveNext Wend End If rsQuery.Close Set rsQuery = Nothing ' second check the pitch-by-pitch entry events Set rsQuery2 = New ADODB.Recordset sql = "select * from plays where gameuid = " + Format(gameUID) + " and finalBase = 4" rsQuery2.Open sql, dbConnection, adOpenForwardOnly, , adCmdText If Not rsQuery2.EOF Then rsQuery2.MoveFirst While Not rsQuery2.EOF If rsQuery2("inningtop") <> 0 Then vRuns = vRuns + 1 Else hRuns = hRuns + 1 End If rsQuery2.MoveNext Wend End If rsQuery2.Close Set rsQuery2 = Nothing ' then check to see if the line score is used j = 0 For i = 1 To 10 j = j + Len(Trim$(tempGame.visitorScore(i))) + Len(Trim$(tempGame.homeScore(i))) Next i If j > 0 Then For i = 1 To 10 vRuns = vRuns + Val(tempGame.visitorScore(i)) hRuns = hRuns + Val(tempGame.homeScore(i)) Next i End If End Sub