Thanks for your reply.
I have a table tblDraw with the fields PlayerID, Player, Seed and Tournament, and tblTournament with fields WinnerID, Winner and Tournament.
I made a form which will write down to these tables. And if you select a certain tournament, the tournament should retrieve the datas again. But it didn´t.
I got an error message, but I can´t translate it well because it is Dutch: syntaxis error (operator missed) in query-epression Tournament.
Here is the code:
Sub RetrieveTournamentTable()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set cnn = CurrentProject.Connection
With rst
.ActiveConnection = CurrentProject.Connection
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
.Source = "SELECT Player, Seed, Tournament FROM tblDraw WHERE Tournament =" & [Forms]![frmTournament]![cboTournament].Value
.Open
End With
If rst.EOF = False Then
For i = 1 To 32
[Forms].Value = rst!Player
[Forms].Value = rst!Seed
[Forms]![frmTournament]![cboTournament].Value = rst!Tournament
Next i
rst.Close
With rst
.ActiveConnection = CurrentProject.Connection
.LockType = adLockPessimistic
.CursorType = adOpenKeyset
.Source = "SELECT Winner, Tournament FROM tblTournament WHERE Tournament= [Forms]![frmTournament]![cboTournament].Value
.Open
End With
For j = 1 To 31
[Forms].Value = rst!Winner
[Forms]![frmTournament]![cboTournament].Value = rst!Tournament
Next j
rst.Close
End If
End Sub