G
GAllen
I can't seem to get this Dsum right.
Dim PreviousScore as Integer
Dim rst As DAO.Recordset
Set rst = Form.RecordsetClone
rst.MoveFirst
PreviousScore = DSum("[Score]", "qryScoring", "GID < '" & rst("GID") & "'
And Location = " & rst("Location"))
rst("GID") is Long, rst("Location") is Integer
PreviousScore = DSum("[Score]", "qryScoring", "GID < " & rst("GID"))
returns 6 which is correct.
but when I add the second criteria I get PreviousScore = 0 and it should be
2. I suspect the
Dsum is failing because my quotes placements are incorrect.
Thanks,
GAllen
Dim PreviousScore as Integer
Dim rst As DAO.Recordset
Set rst = Form.RecordsetClone
rst.MoveFirst
PreviousScore = DSum("[Score]", "qryScoring", "GID < '" & rst("GID") & "'
And Location = " & rst("Location"))
rst("GID") is Long, rst("Location") is Integer
PreviousScore = DSum("[Score]", "qryScoring", "GID < " & rst("GID"))
returns 6 which is correct.
but when I add the second criteria I get PreviousScore = 0 and it should be
2. I suspect the
Dsum is failing because my quotes placements are incorrect.
Thanks,
GAllen