Moonshine
Registered User.
- Local time
- Today, 04:17
- Joined
- Jan 29, 2003
- Messages
- 125
Currentdb.OpenRecordset Failing 
Can anyone help me, as tell me why this:
CurrentDb.OpenRecordset("SELECT [Manager Ref], Sum([Player Cost]) " & _
" FROM [tbl EnteredTeams] INNER JOIN [tbl Player] ON [tbl EnteredTeams].[Player Code] = [tbl Player].[Player Code] " & _
" GROUP BY [tbl EnteredTeams].[Manager Ref] WHERE [Manager Ref] = " & Me.Team)
Is failing?
Its basically selecting 11 records from [tbl EnteredTeams], all with the same [Manager Ref] (As A number 1, 2, 3 and so on) where the [Manager Ref] = the one you select from the combo box on the form. It Then Groups and Sums the [Player Cost] field, to give you a total team cost... Well its supposed to but when i click the button that runs this code, i get the attached error:
Been doing my head on for an hour now
Im sure its something to do with the GROUP BY function, as that's where the error seems to point.
Can anyone help me, as tell me why this:
CurrentDb.OpenRecordset("SELECT [Manager Ref], Sum([Player Cost]) " & _
" FROM [tbl EnteredTeams] INNER JOIN [tbl Player] ON [tbl EnteredTeams].[Player Code] = [tbl Player].[Player Code] " & _
" GROUP BY [tbl EnteredTeams].[Manager Ref] WHERE [Manager Ref] = " & Me.Team)
Is failing?
Its basically selecting 11 records from [tbl EnteredTeams], all with the same [Manager Ref] (As A number 1, 2, 3 and so on) where the [Manager Ref] = the one you select from the combo box on the form. It Then Groups and Sums the [Player Cost] field, to give you a total team cost... Well its supposed to but when i click the button that runs this code, i get the attached error:
Been doing my head on for an hour now