Insert con datos nulos

Meifer
01 de Julio del 2004
Hola amigos tengo una sentencia de insertar, ella funciona correctamente con todos los campos tiene informacion, pero cuando hay un campo en blanco es decir el usuario no quiere guardar nada todavia..... la funcion da un erro de null..... me podrian ayudar q condicion le coloco para q guarde el valor nulo o no guarde nada en ese campo.... gracias de antemano!!! :-(

SQL = "insert into o_compra (NRO_OC,FECHA_OC,NRO_SOL,NRO_ADD,CONTACTO,NRO_REQ,FECHA_REQ,NRO_ARANCEL,LUGAR_ENT,"
SQL = SQL & "NRO_FACT,FECHA_FACT,FOB,CANT_BL,CANT_REC,MERMA,OBSERV,IMP_ORIGEN,TOTAL_FACTURA,"
SQL = SQL & "DER_IMPP,DER_IMP,TASA_ADUANAp,TASA_ADUANA,IMP_VARIOSp,IMP_VARIOS,CAG_ADUANp,CAG_ADUAN,IMP_MUNICp,IMP_MUNIC,OGASTO_ADUA,TOTAL_ADUANA, "
SQL = SQL & "TERQUINCA,SIVENCA,FLETE_TE,LIMP_TANQ,TRANSP,OGASTO_TERRES,TOTAL_TERREST, "
SQL = SQL & "INT_MENSUALP,INT_MENSUAL,INT_IMP_VTAP,INT_IMP_VTA,RIESGO_CAMB,GASTO_BANC,CARTA_CREDIT,OGASTO,PROV_PERDIP,PROV_PERDI,TOTAL_OGASTO) values "
SQL = SQL & "(" & Me.Txt1(0) & ",'" & mskfields(0) & "'," & Me.Txt1(1) & "," & Me.Txt1(4) & ",'" & Me.Txt1(5) & "'," & Me.Txt1(6) & ",'" & Me.mskfields(1) & "'," & Me.Txt1(7) & ",'" & Me.Txt1(8) & "',"
SQL = SQL & "" & CDec(Me.Txt2(1)) & ",'" & mskfields(2) & "'," & CDec(Me.Txt2(3)) & "," & CDec(Me.Txt2(6)) & "," & CDec(Me.Txt2(7)) & "," & CDec(Me.Txt2(8)) & ", '" & CDec(Me.Txt2(9)) & "' ," & CDec(Me.Txt2(10)) & "," & CDec(Me.Txt2(11)) & ","
SQL = SQL & "" & CDec(Me.Txt3(1)) & "," & CDec(Me.Txt3(2)) & "," & CDec(Me.Txt3(3)) & "," & CDec(Me.Txt3(4)) & "," & CDec(Me.Txt3(5)) & "," & CDec(Me.Txt3(6)) & "," & CDec(Me.Txt3(7)) & "," & CDec(Me.Txt3(8)) & "," & CDec(Me.Txt3(9)) & "," & CDec(Me.Txt3(10)) & "," & CDec(Me.Txt3(11)) & "," & CDec(Me.Txt3(12)) & ","
SQL = SQL & "" & CDec(Me.Txt4(1)) & "," & CDec(Me.Txt4(2)) & "," & CDec(Me.Txt4(3)) & "," & CDec(Me.Txt4(4)) & "," & CDec(Me.Txt4(5)) & "," & CDec(Me.Txt4(6)) & "," & CDec(Me.Txt4(7)) & ","
SQL = SQL & "" & CDec(Me.txt5(1)) & "," & CDec(Me.txt5(2)) & "," & CDec(Me.txt5(3)) & "," & CDec(Me.txt5(4)) & "," & CDec(Me.txt5(5)) & "," & CDec(Me.txt5(6)) & "," & CDec(Me.txt5(7)) & "," & CDec(Me.txt5(8)) & "," & CDec(Me.txt5(10)) & "," & CDec(Me.txt5(11)) & "," & CDec(Me.txt5(9)) & ")"
dbcomp.Execute SQL

solidsnake©
01 de Julio del 2004
Ok solo has esto

a todos estos datos concatenales esto

"" & campo.txt

ej

CDec(Me.txt5(8) & "")

Espero que te ayude

Saludos