-1

I am trying to insert records from one table into another using a sql statement in vba. I came up with this but everytime I try to run it, it just says that there are too few parameters and it expected 1. I am not really sure why this is happening as I triple checked my INSERT statement for errors. Any help would be greatly appreciated!!

verifSERFF = "INSERT INTO SERFFVerified ([CLIENT ID], [CLIENT NAME], [MARKET SEGMENT], [FORMULARY ID], [FORMULARY NAME], [FORMULARY VERSION],[SERFF EXPORTED],[SERFF EXPORTED DATE],[APPROVED DATE]) " & _
             "SELECT DD.[CLIENT ID], DD.[CLIENT NAME], DD.[MARKET SEGMENT], DD.[FORMULARY ID], DD.[FORMULARY NAME], DD.[FORMULARY VERSION],DD.[SERFF EXPORTED],DD.[SERFF EXPORTED DATE], DD.[APPROVED DATE] " & _
             "FROM " & tableName & " as DD "
Erik A
  • 31,639
  • 12
  • 42
  • 67
William
  • 9
  • 3
  • eliminate the space between table and fields? looks like it should work: http://stackoverflow.com/questions/74162/how-to-do-insert-into-a-table-records-extracted-from-another-table and if you run it setting a break point on verifserff.. what is the value of the variable perhaps tablename isn't what you think it is.. or set a msgbox after the line showing the value of verifserff and try to run that statement directly in access... – xQbert Dec 04 '14 at 18:39
  • 1
    Check your column names, Acess will give that "parameters" error when you have a typo (=a name that is not recognised as a column) – Hans Kesting Dec 04 '14 at 18:46

1 Answers1

1

I think when the Sql Query Fields dont match with table fields Name Or a Field in Sql Query dont exist in Table.

Hamed Naeemaei
  • 8,052
  • 3
  • 37
  • 46