I have a append query that I am trying to create in vb.
When I run it I get this Error
Too few parameters, Expected 5
Here is the code I am using
strSQL = "INSERT INTO Upload ( JID, DocDate, Type, CompanyCode, PostingDate, " _
& "Period, Curancy, ReferenceDocument, HeaderText, Account, Amount, " _
& "DebitCreditIndicator, ShortText ) " _
& "SELECT 1 as JID, (Format(Date(), ""mmddyyyy"") AS DocDate," _
& """ZU"" AS Type, ""1000"" AS CompanyCode, " _
& "[Forms]![Posting Date/period]![Posting Date] AS PostingDate, " _
& "[Forms]![Posting Date/period]![Period] AS Period, ""USD"" AS Curancy, " _
& """90-CompaqCapital"" AS ReferenceDoc, " _
& """HP Sched "" & [Forms]![Posting Date/period]![Schedule#] & ""-"" & " _
& "[Forms]![Posting Date/period]![Month] AS HeaderText, " _
& """152100"" AS Account, [Forms]![Posting Date/period]![Amount] AS Amount, " _
& """C"" AS DebitCreditIndicator, " _
& """HP Schedule "" & [Forms]![Posting Date/period]![Schedule#] & "" for "" & " _
& "[Forms]![Posting Date/period]![Month] AS ShortText"
The form that is runing the code is the one that has all of the data I am pulling into the table.
I also would like to make the JID feild a veriable that the sql calls in.
When I run it I get this Error
Too few parameters, Expected 5
Here is the code I am using
strSQL = "INSERT INTO Upload ( JID, DocDate, Type, CompanyCode, PostingDate, " _
& "Period, Curancy, ReferenceDocument, HeaderText, Account, Amount, " _
& "DebitCreditIndicator, ShortText ) " _
& "SELECT 1 as JID, (Format(Date(), ""mmddyyyy"") AS DocDate," _
& """ZU"" AS Type, ""1000"" AS CompanyCode, " _
& "[Forms]![Posting Date/period]![Posting Date] AS PostingDate, " _
& "[Forms]![Posting Date/period]![Period] AS Period, ""USD"" AS Curancy, " _
& """90-CompaqCapital"" AS ReferenceDoc, " _
& """HP Sched "" & [Forms]![Posting Date/period]![Schedule#] & ""-"" & " _
& "[Forms]![Posting Date/period]![Month] AS HeaderText, " _
& """152100"" AS Account, [Forms]![Posting Date/period]![Amount] AS Amount, " _
& """C"" AS DebitCreditIndicator, " _
& """HP Schedule "" & [Forms]![Posting Date/period]![Schedule#] & "" for "" & " _
& "[Forms]![Posting Date/period]![Month] AS ShortText"
The form that is runing the code is the one that has all of the data I am pulling into the table.
I also would like to make the JID feild a veriable that the sql calls in.