Update Query not updateable? (1 Viewer)

MARKYB0Y

Registered User.
Local time
Today, 10:35
Joined
Jun 28, 2008
Messages
18
Hi,

I am trying to run a query to update all the teamnames in the scores table to be the same as whatever teamname is in ID1 slot

the select statement runs fine on its own so it must be something in the syntax
also, UPDATE [Scores] SET [Scores].[Teamname] = "anything" works just fine

Code:
UPDATE [Scores] SET [Scores].[Teamname] = (Select [Scores].[Teamname] FROM [Scores] where [Scores].[ID]=1)

I use SQL normally and would use "update TABLE set COLUMN=(Query)" and it would be fine, is Access 2007 looking for a different set of parameters?

thanks in advance of assistance
 

Jon K

Registered User.
Local time
Today, 10:35
Joined
May 22, 2002
Messages
2,209
Try using DLookup() instead of the subquery.

UPDATE Scores SET Teamname = DLookup("Teamname","Scores","[ID]=1");
.
 

Users who are viewing this thread

Top Bottom