Share via

Run-time Error 3077: Missing Operator

Anonymous
2015-02-13T20:18:29+00:00

Hey Guys!

I'm having trouble with this Access VB String:

Private Sub cmdAdd_Click()

    'add data entered to table

    CurrentDb.Execute "INSERT INTO Resources([Title], [Author], [Category], [Rating], [Description], [ResourceLocation]) " & " VALUES (" & Me.TitleInput & "','" & Me.AuthorInput & "','" & Me.CategoryInput & "','" & Me.RatingInput & "','" & Me.DescriptionInput & "','" & Me.ResourceLocationInput & "')"

    'refresh table to display new data

    frmResourceEditorSub.Form.Requery

End Sub

In which I'm trying to get all the following information inserted into my table called Resources. Bellow is my current "Design View" for said Table.

http://i.imgur.com/C7w0ERz.png

I've getting this error message back: http://i.imgur.com/R6GRS8G.png

If theres anything else I can provide.

Thank you,

Clovis

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2015-02-13T20:33:01+00:00

For one thing, you appear to be missing a single quote in your SQL Statement.  Try:

Private Sub cmdAdd_Click()

'add data entered to table

    CurrentDb.Execute "INSERT INTO Resources([Title], [Author], [Category], [Rating], [Description], [ResourceLocation]) " & _

                      " VALUES ('" & Me.TitleInput & "','" & Me.AuthorInput & "','" & Me.CategoryInput & "','" & Me.RatingInput & "','" & Me.DescriptionInput & "','" & Me.ResourceLocationInput & "')"

    'refresh table to display new data

    frmResourceEditorSub.Form.Requery

End Sub

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful