Me. is VBA shorthand for form or report name code is behind. It works only in VBA, not in Access objects. Consider this coding trick - use With some object reference:
Code:
With Me
.POPerGame = Round((.PutOuts / .GiF), 2)
.AssistsPerGame = Round((.Assists / .GiF), 3)
.FieldingPercentage = Round(((.PutOuts + .Assists) / .Chances), 3)
Select Case .Pos
Case "P"
If .AssistsPerGame >= 0.7 Then
.DEF = "9"
Else
.DEF = "8"
End If
If .POPerGame >= 0.3 Then
.DEF = .DEF & "5"
Else
.DEF = .DEF & "4"
End If
If .FieldingPercentage >= 0.99 Then
.DEF = .DEF & "S"
End If
...
End With
In TeamList, why did you not use Autonumber field as primary key? They perform more efficiently than text fields.
In [Sherco Classic] form:
Why bother with variables?
.[Value] is also not necessary.
Can shorten SQL statement and use line continuation:
Code:
Private Sub AwayTeam_AfterUpdate()
Me.AwayRoster.RowSource = "SELECT Name, B, T, Pos, Pos2, Pos3, Pos4, DEF, BB, K, Clutch, Offense, HR, " & _
"Triple, Spd, Gopher, Rate, IE, Rate2, Walk, Strikeout FROM All_Teams WHERE Team=[AwayTeam];"
End Sub
Name is a reserved word - advise not to use reserved words as names. Also, no spaces nor punctuation/special characters (underscore is only exception).