Well, the code you posted is DML, which you would run from an Access query. Since that was what you gave me to work with, that is how I responded. I have no clue what you mean when you say "pressing the datasheet view button" but I can assure you that neither your code nor my code has anything to do with that.
Please open up the query design view, select no tables, select "SQL View", and put the code above in SQL view.
Not sure what you're trying to accomplish here. Unless you are getting data from an external source, you shouldn't even be writing code. Just create a form for entering the data (using the form wizard) and let Access do the hard work.