OK omlouvam se, takze vbs ukladani do db:
Sub CmdSave_onclick
dim Def, radek, kontrolor
dim nick
nick = trim(txtTech.value)
radek = trim(txtOp.value)
kontrolor = trim(txtTech.value)
if trim(txtsn.value)="" and chk_noSN.checked=false then
msgbox "Please input SN. If this part has no SN, please check the red box above. / Prosim o vyplneni SN. Pokud tento dil nema SN, zaskrtnete zluty ctverecek umisteny nahore."
exit sub
end if
if trim(CMBFaultDesc.value)="" then
msgbox "Please input fault description."
exit sub
end if
if trim(CMBDesc.value) = "HDD" and trim(txtFacM.value) = "" then
msgbox "You have to fill Factory Model, because you choose HDD as part description! / Vyplnte prosim pole Factory Model, protoze jste zvolili jako popis HDD!"
exit sub
end if
if trim(CMBVendor.value) = "" then
msgbox "Please put into Vendor correct record, or input NA for unknown. / Vyplnte prosim pole Vendor!"
exit sub
end if
if trim(cmbLine.value) = "" then
msgbox "Please put into Line Rejected correct record, or input NA for unknown. / Vyplnte prosim pole Line Rejected"
exit sub
end if
if trim(cmbShift.value) = "" then
msgbox "Please put into Shift Rejected correct record, or input NA for unknown. / Vyplnte prosim pole Shift Rejected"
exit sub
end if
if trim(cmbArea.value) = "" then
msgbox "Please put into Area Rejected correct record, or input NA for unknown. / Vyplnte prosim pole Area Rejected."
exit sub
end if
if isnumeric(radek) = true then 'checking if operator inserted name, not personal number
msgbox "Please put your correct name, do not put your personal number! / Vlozte prosim do pole DMR Operator JMENO, nikoliv sve osoni cislo!"
exit sub
end if
if isnumeric(kontrolor) = true then ' checking if rework id has numeric or not
msgbox "Please put into Rework Tech ID only name of Reworker, not number! / Vloze prosim do pole Rework Tech ID pouze jmeno, nevkladejte cisla!"
exit sub
end if
if trim(txtOp.value) = "" then
msgox "Please fill field DMR Operator! / Vyplnte prosim pole DMR Operator." 'dmr op field must be filled
exit sub
end if
if left(nick, 1) = "y" then
msgbox "Please input into Rework Tech ID. only name, not personal numbers! / Prosim vlozte do Rework Tech ID pouze jmeno, nevkladejte osobni cisla!"
exit sub
end if
if left(nick, 1) = "Y" then
msgbox "Please input into Rework Tech ID. only name, not personal numbers! / Prosim vlozte do Rework Tech ID pouze jmeno, nevkladejte osobni cisla!"
exit sub
end if
if left(nick, 1) = "t" then
msgbox "Please input into Rework Tech ID. only name, not personal numbers! / Prosim vlozte do Rework Tech ID pouze jmeno, nevkladejte osobni cisla!"
exit sub
end if
if left(nick, 1) = "T" then
msgbox "Please input into Rework Tech ID. only name, not personal numbers! / Prosim vlozte do Rework Tech ID pouze jmeno, nevkladejte osobni cisla!"
exit sub
end if
if trim(txtTech.value) = "" then
msgbox "Please put into Rework Tech. ID correct record, or input NA for unknown. / Vyplnte prosim pole Rework Tech ID."
exit sub
end if
if trim(txtRev.value) = "" then
msgbox "Please put into Part Rev. correct record, or input NA for unknown. / Vyplnte prosim pole Part Rev."
exit sub
end if
if len(trim(txtRev.value)) <> 3 then
msgbox "Revision must have 3 characters! / Pole Revize musi obsahovat 3 znaky!"
exit sub
end if
if trim(txtModel.value) = "" then
msgbox "Please put into Model correct record, or input NA for unknown. / Vyplnte prosim pole Model"
exit sub
end if
if trim(txtUnitSN.value) = "" then
msgbox "Please put into Unit SN correct record, or input NA for unknown. / Vyplnte prosim pole Unit SN."
exit sub
end if
if len(trim(txtUnitSN.value)) <> 10 then
msgbox "Please fill Unit SN correctly - only 10 characters is accepted! / Prosim vyplnte pole Unit SN, je akceptovano pouze 10 znaku!"
exit sub
end if
if trim(txtDebit.value) = "" then
msgbox "Please put into Debit Note Nr. correct record, or input NA for unknown. / Vyplnte prosim pole Debit Note Nr."
exit sub
end if
if len(trim(txtRev.value)) <> 3 then 'povoleno jen 3 znaky v poli Part Rev. / only 3 chars enabled to put
msgbox "Part Rev. must have only 3 characters! / Pole Part Rev. musi mit vyplneno max. a min. 3 znaky!"
exit sub
end if
if len(trim(txtIEC.value))<>12 or len(trim(txtHP.value))<>10 then
msgbox "Please input correct IECPN, HPPN. / Vlozte spravne cisla IECPN a HPPN"
exit sub
end if
if len(trim(txtSN.value))<>10 and len(trim(txtSN.value))<>14 and chk_noSN.checked=false then
msgbox "Please input correct SN. / Vlozte spravne cislo SN"
exit sub
end if
'if left(trim(txtSN.value),4) = " " and len(trim(txtCT.value))=0 then
' msgbox "Please input CT No."
' exit sub
'end if
'if chk_noSN.checked=false then DB.SQL= "DMR..DMR_Save 1, '" & TRIM(txtSN.value) & "', '" & TRIM(txtIEC.value) & "','" & TRIM(txtHP.value) & "','" & trim(txtCT.value) & "','" & trim(CMBDesc.value) & "', '" & TRIM(txtFacM.value) & "', '" & trim(txtVPM.value) & "', '" & trim(txtDatecode.value) & "', '" & trim(CMBFaultDesc.value) & "', '" & trim(txtCosmetic.value) & "', '" & trim(CMBVendor.value) & "', '" & trim(cmbLine.value) & "', '" & trim(cmbShift.value) & "', '" & trim(cmbArea.value) & "', '" & trim(txtOP.value) & "', '" & trim(txtTech.value) & "', '" & trim(txtRev.value) & "', '" & trim(CMBModel.value) & "', '" & trim(txtModel.value) & "', '" & trim(txtUnitSN.value) & "', '" & trim(txtDebit.value) & "','" & cmbRtn.value & "','" & cint(CNT_Scan)+1 & "', '" & PcName & "', '', '','" & txtQty.value & "'"
DB.SQL= "DMR..DMR_Save 1, '" & TRIM(txtSN.value) & "', '" & TRIM(txtIEC.value) & "','" & TRIM(txtHP.value) & "','" & trim(txtCT.value) & "','" & trim(CMBDesc.value) & "', '" & TRIM(txtFacM.value) & "', '" & trim(txtVPM.value) & "', '" & trim(txtDatecode.value) & "', '" & trim(CMBFaultDesc.value) & "', '" & trim(txtCosmetic.value) & "', '" & trim(CMBVendor.value) & "', '" & trim(cmbLine.value) & "', '" & trim(cmbShift.value) & "', '" & trim(cmbArea.value) & "', '" & trim(txtOP.value) & "', '" & trim(txtTech.value) & "', '" & trim(txtRev.value) & "', '" & trim(CMBModel.value) & "', '" & trim(txtModel.value) & "', '" & trim(txtUnitSN.value) & "', '" & trim(txtDebit.value) & "','" & cmbRtn.value & "','" & cint(CNT_Scan)+1 & "', '" & PcName & "', '', '','" & txtQty.value & "'"
'if chk_noSN.checked=true then DB.SQL= "DMR..DMR_Save 2, '" & TRIM(txtSN.value) & "', '" & TRIM(txtIEC.value) & "','" & TRIM(txtHP.value) & "','" & trim(txtCT.value) & "','" & trim(CMBDesc.value) & "', '" & TRIM(txtFacM.value) & "', '" & trim(txtVPM.value) & "', '" & trim(txtDatecode.value) & "', '" & trim(CMBFaultDesc.value) & "', '" & trim(txtCosmetic.value) & "', '" & trim(CMBVendor.value) & "', '" & trim(cmbLine.value) & "', '" & trim(cmbShift.value) & "', '" & trim(cmbArea.value) & "', '" & trim(txtOP.value) & "', '" & trim(txtTech.value) & "', '" & trim(txtRev.value) & "', '" & trim(CMBModel.value) & "', '" & trim(txtModel.value) & "', '" & trim(txtUnitSN.value) & "', '" & trim(txtDebit.value) & "','" & cmbRtn.value & "','" & cint(CNT_Scan)+1 & "', '" & PcName & "', '', '','" & txtQty.value & "'"
DB.Refresh
msgbox DB.Recordset.fields(0)
txtSN.value=""
txtCosmetic.value=""
txtct.value=""
txtDatecode.value=""
txtDebit.value=""
txtFacM.value=""
txtHP.value