Question : Code line too long

Hello all,

I have a code line to long and i dont know how to make it work.

Could you help me please?

Thanks

1:
2:
Set MyRecSet1 = MyConn.Execute("INSERT INTO Inventaire  (Période, No_Bon, Pays, Description_du_produit,Quantité_commandée, Valeur_produit_fini, No_PO_1, Pays_du_brut_1,Composante_1, Quantité_Comp_1 ) VALUES ( '" & Format(Date, "dd mmmm yyyy") & "' , '" & txtNumBon.Text & "' , '" & txtPays.Text & "' , '" & Des_prod.Text & "' , '" & txtQté.Text & "' , '" & lblCoûtInventaire1.Caption & "' , '" & txtPO1.Text & "' , '" & txtBrut1.Text & "' , '" & txtComposante1.Text & "' , '" & txtQté.Text & "' _)") _
     VALUES( '" & txtPO2.Text & "' , '" & txtBrut2.Text & "' , '" & txtComposante2.Text & "' , '" & txtQté.Text & "' )")

Answer : Code line too long

You appear to have the VALUES term appearing twice in your statement - perhaps this is the problem?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Set MyRecSet1 = MyConn.Execute( _
 "INSERT INTO Inventaire  (Période, No_Bon, Pays, Description_du_produit,Quantité_commandée, Valeur_produit_fini, No_PO_1, Pays_du_brut_1,Composante_1, Quantité_Comp_1 ) VALUES ( '" & _
  Format(Date, "dd mmmm yyyy") & _
  "' , '" & txtNumBon.Text & _
  "' , '" & txtPays.Text & _
  "' , '" & Des_prod.Text & _
  "' , '" & txtQté.Text & _
  "' , '" & lblCoûtInventaire1.Caption & _
  "' , '" & txtPO1.Text & _
  "' , '" & txtBrut1.Text & _
  "' , '" & txtComposante1.Text & _
  "' , '" & txtQté.Text & _
  "' , '" & txtPO2.Text & _
  "' , '" & txtBrut2.Text & _
  "' , '" & txtComposante2.Text & _
  "' , '" & txtQté.Text & "' )")
Random Solutions  
 
programming4us programming4us