INSERT statement Syntax in VB.net with Access DB

Hi,
I have an INSERT statement that appears identical to every other INSERT statement I have used but for some reason I keep getting an error message about the syntax. I've no idea what I am doing wrong. Any suggestions as to what's wrong with the code I have pasted below? Is there something huge wrong with the INSERT that I'm missing? It's a VB.net application that reads and writes to an Access XP database. All the field names and table names are correct as far as I can make out. The detail of the error message is as follows: "In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user". Any thoughts?
Thanks.
Dim myOLEDBConnection As New OleDbConnection(My.Settings.WillsDBConnectionString)
 
        Dim myWillsCommand As New OleDbCommand("INSERT INTO tblWills (WillLetter, WillNumber, WillCode, ClientName, Address, DocNo, DiskNo, Comments, Year, Createdby, Checkedby, Location) VALUES (@WillLetter, @WillNumber, @WillCode, @ClientName, @Address, @DocNo, @DiskNo, @Comments, @Year, @Createdby, @Checkedby, @Location)", myOLEDBConnection)
 
        With myWillsCommand.Parameters
            .Add(New OleDbParameter("@WillLetter", Me.txtWillLetter.Text))
            .Add(New OleDbParameter("@WillNumber", Me.txtWillNumber.Text))
            .Add(New OleDbParameter("@WillCode", Me.txtWillNo.Text))
            .Add(New OleDbParameter("@ClientName", Me.txtTestatorName.Text))
            .Add(New OleDbParameter("@Address", Me.txtTestatorAddress.Text))
            .Add(New OleDbParameter("@DocNo", Me.txtWillDocNo.Text))
            .Add(New OleDbParameter("@DiskNo", Me.txtWillDiskNo.Text))
            .Add(New OleDbParameter("@Comments", Me.txtWillComment.Text))
            .Add(New OleDbParameter("@Year", Me.txtWillYear.Text))
            .Add(New OleDbParameter("@CreatedBy", Me.txtWillCreator.Text))
            .Add(New OleDbParameter("@CheckedBy", Me.txtWillChecker.Text))
            .Add(New OleDbParameter("@Location", Me.txtWillLocation.Text))
        End With
 
        myOLEDBConnection.Open()
        myWillsCommand.ExecuteNonQuery()
        myOLEDBConnection.Close()
        MsgBox("New Entry added to Wills Database for" & Me.txtTestatorName.Text)
        myWillsCommand.Dispose()

Open in new window

BozMAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Göran AnderssonCommented:
Year is a reserved keyword.

Change the name of the field in the table, or if that is not possible, put square brackets around the name in the query: [Year].
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BozMAuthor Commented:
Spot on and first time round! Thank you so much. I was doing a lot of head scratching on that one! I can't believe it was so straight forward!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.