I want this SQL statement to execute. But with the CurrentDb.Execute I get error 3061 (Too few parameters. Expected 9). The values given in the variables are legit.
This is my table:
This is my Access form:
And here is my code:
updStr = "INSERT INTO Movie(movie_id, title, duration, description, publication_year, cover_image, previous_part, price, URL)" & _
" VALUES(movie_id = " & Me.TxtMovId & ", title = '" & Me.TxtTitle & "'," & _
" duration = " & Me.TxtDur & ", description = '" & Me.TxtDescr & "'," & _
" publication_year = " & Me.TxtPubl & ", cover_image = " & Me.TxtImage & "," & _
" previous_part = " & Me.TxtPrev & ", price = " & Me.TxtPrice & ", URL = '" & Me.TxtUrl & "')"
CurrentDb.Execute (updStr)
The DoCmd.RunSQL does execute the string, but it has no effect, that's the reason for using CurrentDb.Execute.


INSERT INTO Movie(movie_id) VALUES (27);Bad Access syntax:INSERT INTO Movie(movie_id) VALUES (movie_id=27);After you get that issue sorted, consider a parameter query.