The below code does not seem to produce any errors but is not updating any values in each recordset - is there something blatantly obvious which I have forgotten to do (I know its all not justified, have removed most of the code as is not relevant to the post)?
FYI me.cmb_date (column 0) is an integer
FYI me.cmb_date (column 0) is an integer
Code:
Private Sub btn_submit_Click()
On Error GoTo err_btn_submit_click
Dim rstRed As DAO.Recordset
Dim rstColours As DAO.Recordset
Dim vbaPaid As String
Dim vbaSubmitScore As String
Dim RedScore As Integer
Dim ColourScore As Integer
Dim strRedResult As String
Dim strColourResult As String
Set rstRed = CurrentDb.OpenRecordset("SELECT * FROM qry_match_result_red WHERE m_ref = " & Me.cmb_date)
Set rstColours = CurrentDb.OpenRecordset("SELECT * FROM qry_match_result_colours WHERE m_ref = " & Me.cmb_date)
RedScore = Me.txt_red.Value
ColourScore = Me.txt_colour.Value
strRedResult = "W"
strColourResult = "L"
Do While Not rstRed.EOF
rstRed.Edit
rstRed![t_result] = strRedResult
rstRed![t_for] = RedScore
rstRed![t_against] = ColourScore
rstRed.Update
rstRed.MoveNext
Loop
Do While Not rstColours.EOF
rstColours.Edit
rstColours![t_result] = strColoursResult
rstColours![t_for] = ColourScore
rstColours![t_against] = RedScore
rstColours.Update
rstColours.MoveNext
Loop
rstRed.Close
rstColours.Close
Set rstRed = Nothing
Set rstColours = Nothing
exit_btn_submit_click:
Exit Sub
err_btn_submit_click:
MsgBox Err.Description
Resume exit_btn_submit_click
End Sub