none
RUN-TIME ERROR 3061: Expected 1 RRS feed

  • Question

  • Currentdb.Execute "INSERT INTO tblRegister(Surname,FirstName,MiddleName,Email)" & _
        " VALUES(" & Me.txtSurname & ",'" & Me.txtFName & "','" & Me.txtMName & "','" & Me.txtEmail & "')"

    The code above gives me run time error 3061: Too Few parameter: expected 1

    Also, I discovered that when I typed (1) the figure (1) into the surname textbox on my form, It inserts into the table tblRegister without the error. How can I make it insert name (letter) into the surname and not a number? My surname field datatype in short text. Thanks in advance for the answer
    Thursday, March 23, 2017 12:24 PM

All replies

  • Ignatius -

    Your apostrophe is missing on  Me.txtSurname

    " VALUES(" & Me.txtSurname & ",'" & 

    Try

    " VALUES('" & Me.txtSurname & "','" & 

    Else - Might think Apostrophe vs Double quotes is useful to check/verify:

    Is:

    " VALUES(" & Me.txtSurname & ",'" & Me.txtFName & "','" & Me.txtMName & "','" & Me.txtEmail & "')"

    How about trying:

    " VALUES(""" & Me.txtSurname & """,""" & Me.txtFName & """,""" & Me.txtMName & """,""" & Me.txtEmail & """)"


    -MainSleuth You've Got It, Use It! Engineering, Science, Statistics Solutions http://ToolSleuth.com. For any reply that either helps to answer your question or is the answer, please mark it as helpful or as the answer so others with the same question will have an answer quickly.


    Thursday, March 23, 2017 12:46 PM