Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Too few parameters (Access 2000)

    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Too few parameters (Access 2000)

    - 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.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Too few parameters (Access 2000)

    Thank you so much Hans,it works great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •