kuifje_007
Registered User.
- Local time
- Today, 21:18
- Joined
- Nov 1, 2004
- Messages
- 17
I don´t know why this Recordset doesn´t work. It won´t write down to the table tblPrediction. Maybe you know why?
I have many comboboxen, which is called cboPlayer1, cboPlayer2, and so on.
Function WritedownToTable()
Dim rst As New ADODB.Recordset
Set rst.ActiveConnection = CurrentProject.Connection
Dim intAantalSpelers As Integer
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Source = "SELECT name_ID, round, winner FROM tblPrediction"
rst.Open
While Not rst.EOF
intNumberPlayers = 1
[Forms]![frmPrediction]![naam] = rst!naam
[Forms])) = rst!Winner
intNumberPlayers = intNumberPlayers + 1
rst.MoveNext
Select Case intNumberPlayers
Case 65 To 96: rst("Round") = "2nd"
Case 97 To 112: rst("Round") = "3rd"
Case 113 To 120: rst("Round") = "QF"
Case 121 To 124: rst("Round") = "SF"
Case 125 To 126: rst("Round") = "F"
Case 127: rst("Round") = "W"
End Select
Wend
'Forms("frmPrediction").Refresh
rst.Close
Set rst = Nothing
End Function
I have many comboboxen, which is called cboPlayer1, cboPlayer2, and so on.
Function WritedownToTable()
Dim rst As New ADODB.Recordset
Set rst.ActiveConnection = CurrentProject.Connection
Dim intAantalSpelers As Integer
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Source = "SELECT name_ID, round, winner FROM tblPrediction"
rst.Open
While Not rst.EOF
intNumberPlayers = 1
[Forms]![frmPrediction]![naam] = rst!naam
[Forms])) = rst!Winner
intNumberPlayers = intNumberPlayers + 1
rst.MoveNext
Select Case intNumberPlayers
Case 65 To 96: rst("Round") = "2nd"
Case 97 To 112: rst("Round") = "3rd"
Case 113 To 120: rst("Round") = "QF"
Case 121 To 124: rst("Round") = "SF"
Case 125 To 126: rst("Round") = "F"
Case 127: rst("Round") = "W"
End Select
Wend
'Forms("frmPrediction").Refresh
rst.Close
Set rst = Nothing
End Function