H
Hugh self taught
Hi Guys & Gals,
I need to update tblEvtInput.EvtPoints with tblPointsStructure.PointsAwarded
where criteria in other fields in the tblEvtInput meet criteria in the
tblPointsStructure tbl.
I populate the tblEvtInput from results of a competition as a temporary
collection table. I'm not up to speed enough with using recordsets yet but
have copied various sample to get to the code below which must be incomplete
& obviously doesn't work yet. Below that I've listed the query used as well.
Can you point me in the right direction here.
Dim dbs As DAO.Database
Dim rsPointsUpdate As DAO.Recordset
Set dbs = CurrentDb
Set rsPointsUpdate = dbs.OpenRecordset("SELECT [qryEvtInputPtsUpdate].* FROM
(qryEvtInputPtsUpdate)")
With rsPointsUpdate
If .EOF = False And .BOF = False Then
..MoveFirst
Do While Not rsPointsUpdate.EOF
If tblEvtInput.EvtPlaced = tblPointsStructure.Position And
qryEvtInput.CountOfEvt = tblPointsStructure.InFinal Then
tblEvtInput.EvtPoints = tblPointsStructure.PointsAwarded
End If
..MoveNext
Loop
End If
End With
rsPointsUpdate.Close
Set rsPointsUpdate = Nothing
dbs.Close
Set dbs = Nothing
Query
SELECT tblEvtInput.EvtInput_Idx, tblEvtInput.EvtCompID,
tblEvtInput.EvtNumber, tblEvtInput.EvtStructID, tblEvtInput.EvtCplID,
tblEvtInput.EvtPlaced, tblEvtInput.EvtPoints, tblEvtInput.EvtFinal,
tblEvtInput.EvtTotalPts, tblPointsStructure.PtsStruct_Idx,
tblPointsStructure.Position, tblPointsStructure.InFinal,
tblPointsStructure.PointsAwarded
FROM tblEvtInput INNER JOIN tblPointsStructure ON
tblEvtInput.EvtPoints=tblPointsStructure.PointsAwarded;
I need to update tblEvtInput.EvtPoints with tblPointsStructure.PointsAwarded
where criteria in other fields in the tblEvtInput meet criteria in the
tblPointsStructure tbl.
I populate the tblEvtInput from results of a competition as a temporary
collection table. I'm not up to speed enough with using recordsets yet but
have copied various sample to get to the code below which must be incomplete
& obviously doesn't work yet. Below that I've listed the query used as well.
Can you point me in the right direction here.
Dim dbs As DAO.Database
Dim rsPointsUpdate As DAO.Recordset
Set dbs = CurrentDb
Set rsPointsUpdate = dbs.OpenRecordset("SELECT [qryEvtInputPtsUpdate].* FROM
(qryEvtInputPtsUpdate)")
With rsPointsUpdate
If .EOF = False And .BOF = False Then
..MoveFirst
Do While Not rsPointsUpdate.EOF
If tblEvtInput.EvtPlaced = tblPointsStructure.Position And
qryEvtInput.CountOfEvt = tblPointsStructure.InFinal Then
tblEvtInput.EvtPoints = tblPointsStructure.PointsAwarded
End If
..MoveNext
Loop
End If
End With
rsPointsUpdate.Close
Set rsPointsUpdate = Nothing
dbs.Close
Set dbs = Nothing
Query
SELECT tblEvtInput.EvtInput_Idx, tblEvtInput.EvtCompID,
tblEvtInput.EvtNumber, tblEvtInput.EvtStructID, tblEvtInput.EvtCplID,
tblEvtInput.EvtPlaced, tblEvtInput.EvtPoints, tblEvtInput.EvtFinal,
tblEvtInput.EvtTotalPts, tblPointsStructure.PtsStruct_Idx,
tblPointsStructure.Position, tblPointsStructure.InFinal,
tblPointsStructure.PointsAwarded
FROM tblEvtInput INNER JOIN tblPointsStructure ON
tblEvtInput.EvtPoints=tblPointsStructure.PointsAwarded;