Couple of things, firstly field name slike Year and Month are no no's as they are known as Access Reserved words. Access can get confused between field names and reserved words. You need to rename them as soon as possible.
Secondly is the ID a number field, if so, then you do not need the quotes round the value.
Thanks for your reply.
Year and Month are the column fileds in the database(Sql). Do you want me to chnage these names in the sql table?
Also removed the quotes from ID, same error.
Error 3073, Operation must use an updatable query.
As per post #5 it appears you do not have the necessary permissions to write back to the SQL data tables. Check with the owner of the SQL database and ask them for permission to edit etc.
There may be a valid reason why these permissions have not been granted.
Here is something else, My identity key in the table wasn't a primary key.I changed it to Primary key,now its giving me the error '3622': You must use the dbSeeChangesoption with Openrecordset when accessing a sql server table that has an identity column.
When you link a SQL Server table from Access it will many times come up with a dialog as you link it where you have to tell it what the key field or fields are. If you don't do that, it will not be updateable. Try deleting the table from Access and re-linking and seeing if it gives you that. If not, it still might work after relinking because you didn't have a primary key field set originally and Access needs SQL Server tables to have a PK field (or fields) set to be able to do updates.
Thanks for ur reply.
Error i was gettin not because of PK(i did set PK in the sql table and reconnected it to the Access), it was because i wasn't using 'dbseechanges' while i was pulling the data from Sql and was tring to do 'db.execute' rather than doing docmd.runsql.
Anyways its working fine now.
Thanks for the help.
Are you saying that you're using DoCmd.RunSQL strSQLStatement
instead of db.Execute strSQLStatement, dbSeeChanges
?
If that's the case, then is there a particular reason why?
(Given your SQL statement and lack of parameters I can't even see a "cheat" reason why ;-)