Sub btnupdate_Click
If edtnewhighscore.Text = "" OR edtnewbesttime.Text = "" Then
Msgbox("Please enter some numbers", "ERROR")
Return
Else
highscore = edtnewhighscore.Text
time = edtnewbesttime.Text
' Write_Highscore 'My code is not working
'updateHighScores 'The is code is not working
'^this required 4 parameters you can not call a sub procedure like this the correct way is below
updateHighScores(SQL1,highscore,time,level)
End If
End Sub
Sub updateHighScores (SQL As SQL,highscore1 As String,time1 As String,level1 As String)
'^ This was changed becuase you can not use a global parameter in an enclosed block
' Create Map of Scores
Dim ScoreFields As Map
ScoreFields.Initialize
ScoreFields.Put("score",highscore1)
ScoreFields.Put("time",time1)
' Create Where Clause Map
Dim WhereFields As Map
WhereFields.Initialize
WhereFields.Put("level", level1) '< is level the actual ID ?
' Do you have a column Called level? Should it be
' WhereFields.Put("level", level)
DBUtils.UpdateRecord2(SQL, "highscores", ScoreFields, WhereFields)
End Sub