K
Kamil
Hi.
I'm trying to insert one record as a copy of existing one with some
fields modified.
Result: Run-time error 3346: Number of query values and destination
fields are not the same.
I've counted the records on both sides, and for me everything seems to
be correct... What is the problem then?
sSQL = "INSERT INTO T_SMP_FIFO([KEY], [STDIV_SKU], [SMDINR], [PKTWL],
[SMARNR], [SMCOLR], [SMTYPE], [SMWIDT], [SMLENG], [SMCRMM], [SMCRDD],
[SMCRHH], [SMCRNN], [SMCRSS], [SMCRMS], [SMCRYR], [SMQUAN], [SMKIND],
[SMTEXT], [SMUSID], [SMORNR], [SMRCNR], [SMLINR], [SMWRHS], [SMSUDN],
[SMSUNR], [SMBOOK], [SMINEX], [SMPAPP], [SMLIN9], [DOCNR], [OPTG],
[SMVAL], [HISTPRIC], [Pric_FIFO], [Quant_FIFO], [ZNACZNIK],
[DataCzas], [FLOW], [FORVAL])" & _
"SELECT '" & sNewKey & "',
[STDIV_SKU], [SMDINR], [PKTWL], [SMARNR], [SMCOLR], [SMTYPE],
[SMWIDT], [SMLENG], [SMCRMM], [SMCRDD], [SMCRHH], [SMCRNN], [SMCRSS],
" & iNewMS & ", [SMCRYR]," & _
rsTEMP!smquan & ", " & _
rsTEMP!smkind & ", '" & _
rsTEMP!smtext & "', '" & _
rsTEMP!smusid & "', " & _
rsTEMP!smornr & ", " & _
rsTEMP!smrcnr & ", " & _
rsTEMP!smlinr & ",
[SMWRHS], " & _
rsTEMP!smsudn & ", " & _
rsTEMP!smsunr & ",
[SMBOOK], [SMINEX], [SMPAPP], [SMLIN9], '" & _
rsTEMP!docnr & "', '" & _
rsTEMP!optg & "', " & _
rsTEMP!pric_fifo *
dblCopyQuan & ", " & _
rsTEMP!pric_fifo & ", " &
_
rsTEMP!pric_fifo & ", " &
_
dblCopyQuan & ", '" & _
rsTEMP!znacznik & "',
[DataCzas], '" & _
rsTEMP!FLOW & "', 'YES' AS
FORVAL" & _
"FROM T_SMP_FIFO " & _
"WHERE KEY='" & rsFIFO!Key &
"'"
I'm trying to insert one record as a copy of existing one with some
fields modified.
Result: Run-time error 3346: Number of query values and destination
fields are not the same.
I've counted the records on both sides, and for me everything seems to
be correct... What is the problem then?
sSQL = "INSERT INTO T_SMP_FIFO([KEY], [STDIV_SKU], [SMDINR], [PKTWL],
[SMARNR], [SMCOLR], [SMTYPE], [SMWIDT], [SMLENG], [SMCRMM], [SMCRDD],
[SMCRHH], [SMCRNN], [SMCRSS], [SMCRMS], [SMCRYR], [SMQUAN], [SMKIND],
[SMTEXT], [SMUSID], [SMORNR], [SMRCNR], [SMLINR], [SMWRHS], [SMSUDN],
[SMSUNR], [SMBOOK], [SMINEX], [SMPAPP], [SMLIN9], [DOCNR], [OPTG],
[SMVAL], [HISTPRIC], [Pric_FIFO], [Quant_FIFO], [ZNACZNIK],
[DataCzas], [FLOW], [FORVAL])" & _
"SELECT '" & sNewKey & "',
[STDIV_SKU], [SMDINR], [PKTWL], [SMARNR], [SMCOLR], [SMTYPE],
[SMWIDT], [SMLENG], [SMCRMM], [SMCRDD], [SMCRHH], [SMCRNN], [SMCRSS],
" & iNewMS & ", [SMCRYR]," & _
rsTEMP!smquan & ", " & _
rsTEMP!smkind & ", '" & _
rsTEMP!smtext & "', '" & _
rsTEMP!smusid & "', " & _
rsTEMP!smornr & ", " & _
rsTEMP!smrcnr & ", " & _
rsTEMP!smlinr & ",
[SMWRHS], " & _
rsTEMP!smsudn & ", " & _
rsTEMP!smsunr & ",
[SMBOOK], [SMINEX], [SMPAPP], [SMLIN9], '" & _
rsTEMP!docnr & "', '" & _
rsTEMP!optg & "', " & _
rsTEMP!pric_fifo *
dblCopyQuan & ", " & _
rsTEMP!pric_fifo & ", " &
_
rsTEMP!pric_fifo & ", " &
_
dblCopyQuan & ", '" & _
rsTEMP!znacznik & "',
[DataCzas], '" & _
rsTEMP!FLOW & "', 'YES' AS
FORVAL" & _
"FROM T_SMP_FIFO " & _
"WHERE KEY='" & rsFIFO!Key &
"'"