Syntax error in INSERT INTO statementI have this code to save data in access database and i have this error<br/>Syntax error in INSERT INTO statement<br/>code <br/><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"> <p>Dim</p> </font></span> <p><span style="font-size:x-small"> f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 </span><span style="font-size:x-small;color:#0000ff">As</span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff">String</span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="font-size:x-small;color:#0000ff">Dim</span><span style="font-size:x-small"> f11, f12, f13, f14, f15, f16, f17, f18 </span><span style="font-size:x-small;color:#0000ff">As</span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff">String</span></p> <span style="font-size:x-small"><font size=2> <p>f1 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox1.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f2 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker1.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f3 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox1.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f4 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox2.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f5 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox3.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f6 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox4.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f7 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox5.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f8 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox6.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f9 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox8.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f10 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox3.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f11 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox7.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f12 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox9.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f13 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox10.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f14 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox11.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f15 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox4.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f16 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker2.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f17 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker3.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f18 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox2.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;INSERT INTO Cust &quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S = S &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;(sName,Birth_Date,Gender,Nationality,Address,Tel,Mobile,Fax,ID_Num,ID_Type,&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S = S &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;E_mail,Account_Num,Maximum,Card_Name,Card_Type,First_Date,Last_Date,Work_Ttpe)&quot;</span></p> <span style="font-size:x-small"> <p>S = S &amp; f1 &amp; f2 &amp; f3 &amp; f4 &amp; f5 &amp; f6 &amp; f7 &amp; f8 &amp; f9 &amp; f10</p> <font size=2> <p>S = S &amp; f11 &amp; f12 &amp; f13 &amp; f14 &amp; f15 &amp; f16 &amp; f17 &amp; f18 &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;)&quot;</span></p> <span style="font-size:x-small"> <p>Cmd.CommandText = S</p> <p>H = Cmd.ExecuteNonQuery</p> <font size=2> <p>MsgBox(H &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;record Saved&quot;</span><span style="font-size:x-small">)<br/>i want to know where is the error in this code thanks for help </span></p>© 2009 Microsoft Corporation. All rights reserved.Tue, 09 Jun 2009 01:32:36 Zc5583bfb-48db-4b52-98d0-74ad769e54dchttp://social.technet.microsoft.com/Forums/en-US/TNPlans/thread/c5583bfb-48db-4b52-98d0-74ad769e54dc#c5583bfb-48db-4b52-98d0-74ad769e54dchttp://social.technet.microsoft.com/Forums/en-US/TNPlans/thread/c5583bfb-48db-4b52-98d0-74ad769e54dc#c5583bfb-48db-4b52-98d0-74ad769e54dcNageh Omranhttp://social.technet.microsoft.com/Profile/en-US/?user=Nageh%20OmranSyntax error in INSERT INTO statementI have this code to save data in access database and i have this error<br/>Syntax error in INSERT INTO statement<br/>code <br/><span style="font-size:x-small;color:#0000ff"><font size=2 color="#0000ff"> <p>Dim</p> </font></span> <p><span style="font-size:x-small"> f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 </span><span style="font-size:x-small;color:#0000ff">As</span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff">String</span></p> <span style="font-size:x-small"><font size=2> <p> </p> </font></span> <p><span style="font-size:x-small;color:#0000ff">Dim</span><span style="font-size:x-small"> f11, f12, f13, f14, f15, f16, f17, f18 </span><span style="font-size:x-small;color:#0000ff">As</span><span style="font-size:x-small"> </span><span style="font-size:x-small;color:#0000ff">String</span></p> <span style="font-size:x-small"><font size=2> <p>f1 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox1.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f2 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker1.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f3 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox1.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f4 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox2.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f5 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox3.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f6 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox4.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f7 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox5.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f8 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox6.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f9 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox8.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f10 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox3.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f11 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox7.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f12 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox9.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f13 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox10.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f14 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; TextBox11.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f15 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox4.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f16 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker2.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f17 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; DateTimePicker3.Value &amp; </span><span style="font-size:x-small;color:#a31515">&quot;',&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>f18 =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span><span style="font-size:x-small"> &amp; ComboBox2.Text &amp; </span><span style="font-size:x-small;color:#a31515">&quot;'&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S =</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;INSERT INTO Cust &quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S = S &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;(sName,Birth_Date,Gender,Nationality,Address,Tel,Mobile,Fax,ID_Num,ID_Type,&quot;</span></p> <span style="font-size:x-small"><font size=2> <p>S = S &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;E_mail,Account_Num,Maximum,Card_Name,Card_Type,First_Date,Last_Date,Work_Ttpe)&quot;</span></p> <span style="font-size:x-small"> <p>S = S &amp; f1 &amp; f2 &amp; f3 &amp; f4 &amp; f5 &amp; f6 &amp; f7 &amp; f8 &amp; f9 &amp; f10</p> <font size=2> <p>S = S &amp; f11 &amp; f12 &amp; f13 &amp; f14 &amp; f15 &amp; f16 &amp; f17 &amp; f18 &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;)&quot;</span></p> <span style="font-size:x-small"> <p>Cmd.CommandText = S</p> <p>H = Cmd.ExecuteNonQuery</p> <font size=2> <p>MsgBox(H &amp;</p> </font></span> <p><span style="font-size:x-small;color:#a31515">&quot;record Saved&quot;</span><span style="font-size:x-small">)<br/>i want to know where is the error in this code thanks for help </span></p>Tue, 09 Jun 2009 01:32:35 Z2009-06-09T01:32:35Z