• Too few parameters (Access 2000)

    Author
    Topic
    #443411

    In my form i have a list box called List618.In the comman button a have a code that gives the error message ” Too few parameters.Expected 1″

    Str sql = “INSERT INTO ProductsArchive SELECT * FROM Products WHERE Productid = Me | List618
    What is thereason of this error ?l.

    Viewing 0 reply threads
    Author
    Replies
    • #1069522

      – The name of a variable cannot contain spaces, so instead of Str sql use strSQL.
      – You cannot refer to Me within a string.
      – The character | is not a valid separator for controls.
      – The closing quotes ” are missing.

      Try

      strSQL = “INSERT INTO ProductsArchive SELECT * FROM Products WHERE Productid = ” & Me!List618

      Note: you should give controls meaningful names. If you have to modify the form and its code in a few months, a name such as lstProducts will immediately give you an idea what the control is used for, while List618 is meaningless.

    Viewing 0 reply threads
    Reply To: Too few parameters (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: