Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Too few parameters ? (Access 2000)

    I want to create a new table Temp and append to it.However i cannot do it since i get the message
    too few parameters.I suppose my function is wrong ?
    Public Function AppendTemp()
    Dim strSQL As String
    strSQL = " SELECT Contacts.ContactID ," & _
    " Contacts.address," & _
    " Contacts.city," & _
    " Contacts.works," & _
    " Contacts.works1," & _
    " Contacts.home," & _
    " Contacts.mobi," & _
    " Contacts.dresser," & _
    " Contacts.fax" & _
    " INTO Temp FROM Contacts"
    CurrentDb.Execute strSQL
    CurrentDb.Execute "CREATE INDEX PrimaryKey ON Temp (ContactID) WITH PRIMARY"
    End Function

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

    Re: Too few parameters ? (Access 2000)

    The error probably means that one of the field names is incorrect, i.e. the field does not exist in the Contacts table or there is a spelling error. Check very carefully that the field names in the SQL string correspond exactly to the field names in the Contacts table.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Too few parameters ? (Access 2000)

    Another possbility is that there is a space missing somewhere, so that two words that should be separated are run together.

    What you have written looks OK, but put in a Msgbox(strSql) or degub.print(strSql) before CurrentDb.Execute strSQL so that you can inspect the actual sql statement before it executes.
    Regards
    John



Posting Permissions

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