A1VBCode Forums

Insert into Syntax error


http://www.a1vbcode.com/vbforums/Topic32011.aspx

By LovelySingh - 6/26/2013

Hello All,



I am very new to vb.net and have limited knowledge of the coding part,



My Question is may be very simple to ask, but i m struggling with the insert into statement which i am saving from vb.net to access.



I have Textbox,combobox,radiobuttons & datepickers on the form.



I have tried many things to get this solved, hope this forum will help me in resolving the same.



i am adding a part of my code where its not working,



cmd.CommandText = "INSERT INTO SAMI_Data (RefNo, CustName, EmailSub, ReqName, ReqEntity, Mailbox, SalesRegion, QuoteAttached, OrderType, OrderSubType, ReqSLA, RequestRecDt, Nolinesrec, TargetedDate, TargetStatus, AcknDate, LinesProcessed, Vendor, PricingOwner, ReassignedOwner, Modification, ModificationDate, DataValComm, Quote Created, No Quotes Crt, Site Created, No Sites Created, Case Logged, Case Create date, Case End Date, No Case Logged, Reason for case Log, PO Raised, PO Raised Date, PO Approv Date, No PO Raised, Total QT Cost, Total Revenue, CR Ratio, SSS, Converted into contract, Net Quote Amt, Net Pricing Amt, Curr Req Status, Completion Date, Final Comments) " & _

" VALUES(" & Me.RefNo.Text & ",'" & Me.CstName.Text & "','" & _

Me.EmailSub.Text & "','" & Me.ReqName.Text & "','" & _

Me.ReqEntity.Text & "','" & Me.Mailbox.Text & "','" & _

Me.Salesrgn.Text & "','" & Me.Qtattached & "','" & _

Me.Ordertype.Text & "','" & Me.OrderSubType.Text & "','" & _

Me.ReqSLA.Text & "',#" & Me.Req_Rec_dt.Value.Date & "#,'" & _

Me.Lines_Rec.Text & "','" & Me.TargetDt.Text & "','" & _

Me.TargetStatus.Text & "',#" & Me.Ackn_Dt.Value.Date & "#,'" & _

Me.Lines_Process.Text & "','" & Me.Vendor.Text & "','" & _

Me.Pricing_Owner.Text & "','" & Me.Reassigned_Owner.Text & "','" & _

Me.Modify & "',#" & Me.Modification_dt.Value.Date & "#,'" & _

Me.Data_Val_Com.Text & "','" & _

Me.Quotecreated & "','" & Me.NoQtCrt.Text & "','" & _

Me.Sitecreated & "','" & Me.NoSTCrt.Text & "','" & _

Me.caselogged & "',#" & Me.Cs_crt_Dt.Value.Date & "#,#" &

Me.Cs_End_Dt.Value.Date & "#,'" & Me.No_Cs_Crt.Text & "','" &

Me.Cs_reason.Text & "','" & _

Me.POraised & "',#" & Me.PO_raise_dt.Value.Date & "#,#" & _

Me.PO_Approv_dt.Value.Date & "#,'" & Me.No_PO_Crt.Text & "','" & _

Me.TTL_QT_Cost.Text & "','" & Me.TTL_Revenue.Text & "','" &

Me.CR_Ratio.Text & "','" & Me.SSSupdation & "','" &

Me.convrtintocont & "','" & Me.Net_Vendor.Text & "','" &

Me.Net_Pricing.Text & "','" & Me.Current_Status.Text & "',#" &

Me.CompDt.Value.Date & "#,'" & Me.Final_Comm.Text & "')"

cmd.ExecuteNonQuery()
By zack - 7/1/2013

Now i m getting error as "No value given for one or more required parameters"







I counted 46 parameters and 46 values so I'm not sure why you're getting this error. Are you sure there's a value in all the fields?