本文介绍了任何人都可以调试此代码中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

显式选项
Dim mno As Integer''用户权限菜单编号

私人子Form_Load()
致电FormCenter(Me)
致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0

结束子

私人子fill_vs()
出错时转到err_fill_vs
Dim inti As Integer
Dim adorsseva作为新的ADODB.Recordset

如果adorsseva.State = 1,则adorsseva.Close
adorsseva.打开选择SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT,SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6,SEVA_SPLIT7,SEVA_SPL_1,SEVA_SPLIT5,SEVA_SPLIT5,SEVA_SPLIT1,SEVA_SPLIT5,SEVA_SPLIT1,从其中 vsflexseva.Rows = 1
vsflexseva.Rows = 2
如果adorsseva.EOF = False,那么
对于inti = 1到adorsseva.RecordCount
vsflexseva.TextMatrix(inti,0)= adorsseva!SEVA_CODE& "
vsflexseva.TextMatrix(inti,1)= adorsseva!SEVA_NAME& "
vsflexseva.TextMatrix(inti,2)= adorsseva!SEVA_AMOUNT& "
vsflexseva.TextMatrix(inti,3)= adorsseva!SEVA_SPLIT1& "
vsflexseva.TextMatrix(inti,4)= adorsseva!SEVA_SPLIT2& "
vsflexseva.TextMatrix(inti,5)= adorsseva!SEVA_SPLIT3& "
vsflexseva.TextMatrix(inti,6)= adorsseva!SEVA_SPLIT4& "
vsflexseva.TextMatrix(inti,7)= adorsseva!SEVA_SPLIT5& "
vsflexseva.TextMatrix(inti,8)= adorsseva!SEVA_SPLIT6& "
vsflexseva.TextMatrix(inti,9)= adorsseva!SEVA_SPLIT7& "
vsflexseva.TextMatrix(inti,10)= adorsseva!SEVA_SPLIT8& "
vsflexseva.TextMatrix(inti,11)= adorsseva!SEVA_SPLIT9& "
vsflexseva.TextMatrix(inti,12)= adorsseva!SEVA_SPLIT10& "
vsflexseva.TextMatrix(inti,14)= Val(adorsseva!SEVA_ID&")
adorsseva.MoveNext
vsflexseva.Rows = vsflexseva.Rows + 1
下一个
如果结束
如果adorsseva.State = 1,则adorsseva.Close:设置adorsseva = Nothing

退出子
err_fill_vs:
呼叫Error_Message("fill_vs")
结束子

''私有子项vsflexseva_BeforeEdit(ByVal行为长,ByVal行为长,取消为布尔值)
''''如果vsflexseva.Col = 0则''code
''''vsflexseva.EditMaxLength = 5
''''如果结束
''如果vsflexseva.Col = 1则''seva名称
''''vsflexseva.EditMaxLength = 30
''''如果结束
''结束子

私人子vsflexseva_EnterCell()
vsflexseva.Cell(flexcpBackColor,vsflexseva.Row,0,vsflexseva.Row,vsflexseva.Cols-1)=& HD9B8E7''& HDDDAD2''& HFFC0C0
vsflexseva.Cell(flexcpForeColor,vsflexseva.Row,0,vsflexseva.Row,vsflexseva.Cols-1)=& H80000002

如果vsflexseva.Col = 0则''代码
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva代码或按[Esc]退出"
如果结束
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束

如果vsflexseva.Col = 1则''seva名称
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 2那么''评分
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 3那么''split1
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 4然后''split2
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 5然后''split3
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 6然后''split4
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 7则''split5
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 8则''split6
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 9然后''split7
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 10则''split8
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 11然后''split9
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
如果vsflexseva.Col = 12那么''split10
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")< 0然后
lblhelp.Caption ="[Shift] + [Delete]删除记录或按[Esc]退出"
其他
lblhelp.Caption =输入seva名称或按[Esc]退出"
如果结束
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

退出子
如果结束
结束子

Private Sub vsflexseva_KeyDownEdit(ByVal行长,ByVal Col长,KeyCode整数,ByVal Shift整数)
将Dim adorscheck作为新的ADODB.Recordset
Dim adoRSdno作为新的ADODB.Recordset

如果KeyCode = vbKeyReturn或KeyCode = vbKeyRight,那么
如果vsflexseva.Col = 0则''Code
vsflexseva.Col = 13
如果Trim(vsflexseva.TextMatrix(vsflexseva.Row,0))="然后''代码
vsflexseva.Col = 0
vsflexseva.EditCell
其他
如果adorscheck.State = 1,则adorscheck.Close
adorscheck.打开从STAFFMAST_T中选择STAFF_CODE,其中"_
& "STAFF_CODE ="&修剪(vsflexseva.TextMatrix(vsflexseva.Row,0))& ",g_adomast1,adOpenStatic,adLockReadOnly
如果adorscheck.EOF = False,那么
MsgBox代码无法重复...",vbInformation
vsflexseva.Col = 0
vsflexseva.EditCell
退出子
如果结束
vsflexseva.Col = 1

vsflexseva.EditCell
如果结束
退出子
如果结束

如果vsflexseva.Col = 1则''Name
vsflexseva.Col = 13
如果Trim(vsflexseva.TextMatrix(vsflexseva.Row,1))="然后"员工名称
vsflexseva.Col = 1
vsflexseva.EditCell
退出子
如果结束
如果adorscheck.State = 1,则adorscheck.Close
adorscheck.打开从SEVA_MAST中选择SEVA_CODE,其中_
& "SEVA_CODE ="&修剪(vsflexseva.TextMatrix(vsflexseva.Row,0))& "和"__
& "SEVA_ID<>"& Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")& ",g_adomast1,adOpenStatic,adLockReadOnly
vsflexseva.Col = 2
vsflexseva.EditCell
如果adorscheck.EOF = False,那么
MsgBox代码无法重复...",vbInformation
vsflexseva.Col = 0
vsflexseva.EditCell
退出子
如果结束
如果vsflexseva.Col = 2那么
vsflexseva.Col = 3
退出子
如果结束
如果vsflexseva.Col = 3那么
vsflexseva.Col = 4
退出子
如果结束
如果vsflexseva.Col = 4那么
vsflexseva.Col = 5
退出子
如果结束
如果vsflexseva.Col = 5那么
vsflexseva.Col = 6
退出子
如果结束
如果vsflexseva.Col = 6,那么
vsflexseva.Col = 7
退出子
如果结束
如果vsflexseva.Col = 7那么
vsflexseva.Col = 8
退出子
如果结束
如果vsflexseva.Col = 8那么
vsflexseva.Col = 9
退出子
如果结束
如果vsflexseva.Col = 9那么
vsflexseva.Col = 10
退出子
如果结束
如果vsflexseva.Col = 10那么
vsflexseva.Col = 11
退出子
如果结束
如果vsflexseva.Col = 11那么
vsflexseva.Col = 12
退出子
如果结束
如果vsflexseva.Col = 12那么
致电saveseva
退出子
如果结束
出错时转到err_vsflexseva_KeyDownEdit
g_adomast1.BeginTrans

''插入sevamast
如果Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")= 0然后

致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0:vsflexseva.EditCell
退出子

如果adoRSdno.State = 1,则adoRSdno.Close
adoRSdno.Open从SEVA_MAST选择最大(SEVA_ID)",g_adomast1,adOpenStatic,adLockReadOnly
g_adomast1.执行插入SEVA_MAST(SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT,SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6,SEVA_SPLIT9,SEVA_SPLIT9,SEVA_SPLIT7, & 值("& Val(adoRSdno.Fields(0)&")+ 1&,"& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,0)),"'' ,"")&","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,1)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,2)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,3)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,4)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,5)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,6)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,7)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,8)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,9)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,10)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,11)),''","")& ","_
& "& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,12)),''","")& ")"

如果adoRSdno.State = 1,则adoRSdno.Close:设置adoRSdno = Nothing
其他
''更新SEVA_MAST

致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0:vsflexseva.EditCell
退出子

g_adomast1.执行更新SEVA_MAST设置SEVA_NAME ="", Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,1)),''","")& ",SEVA_CODE ="& Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row,0)),''","")& ",其中SEVA_ID =& Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row,14))&")& "

如果结束
g_adomast1.CommitTrans

出现错误时,转到最后一个
致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0
vsflexseva.EditCell

如果结束
如果结束

如果KeyCode = vbKeyDelete且Shift = 1,则
致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0:vsflexseva.EditCell
退出子

Dim adoRSdel作为新的ADODB.Recordset
如果adoRSdel.State = 1,则adoRSdel.Close
adoRSdel.Open从SEVA_MAST中选择SEVA_ID,其中SEVA_ID ="& Val(Trim(Val(vsflexseva.TextMatrix(vsflexseva.Row,2)))&")& ",g_adomast1,adOpenStatic,adLockReadOnly
如果adoRSdel.EOF = False,那么
MsgBox无法删除....已在使用中",vbCritical
vsflexseva.Col = 0
退出子
如果结束
如果MsgBox(您真的要删除该条目吗?",vbYesNo + vbDefaultButton2)= vbYes然后
g_adomast1.执行从SEVA_MAST删除,其中SEVA_ID ="& Val(Trim(Val(vsflexseva.TextMatrix(vsflexseva.Row,14)))&")& ;"

如果结束

致电fill_vs
vsflexseva.Row = vsflexseva.Rows-1
vsflexseva.Col = 0

vsflexseva.EditCell
退出子
如果结束

如果KeyCode = vbKeyEscape,那么
卸载我
如果结束

退出子
上一个:
调用Error_Message("vsflexseva_KeyDownEdit")
退出子
err_vsflexseva_KeyDownEdit:
g_adomast1.RollbackTrans

调用Error_Message("vsflexseva_KeyDownEdit")
结束子

Private Sub vsflexseva_KeyPressEdit(ByVal行长,ByVal Col长,KeyAscii作为整数)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
结束子

私人子vsflexseva_LeaveCell()
如果vsflexseva.Row = 0,则退出Sub
vsflexseva.Cell(flexcpBackColor,vsflexseva.Row,0,vsflexseva.Row,vsflexseva.Cols-1)=& HFFFFFF''& HFFF2FE
vsflexseva.Cell(flexcpForeColor,vsflexseva.Row,0,vsflexseva.Row,vsflexseva.Cols-1)= vbBlack
结束子

私人子saveseva()
Dim adorsmaxid作为新的ADODB.Recordset
Dim adorsseva作为新的ADODB.Recordset
Dim intno As Integer:intno = 0
出现错误时,转到最后一个


出错时转到err_savestones
与vsflexseva
g_adomast1.BeginTrans
''==============================

''如果Val(Trim(.TextMatrix(.Row,14))&")= 0则
''如果adorsmaxid.State = 1则adorsmaxid.Close
" adorsmaxid.打开从STSTOCKMASTER_T中选择max(TRANS_ID),其中TRANSS_TYPE =``N''",g_adomast1,adOpenStatic,adLockReadOnly
" g_adomast1.执行插入STSTOCKMASTER_T(TRANSS_SLNO,TRANS_ID,TRANSS_SID,TRANSS_TYPE,''_
''& "TRANSS_DATE,TRANSS_PNO,TRANSS_STONENO,TRANSS_MINES,TRANSS_QTY,TRANSS_CARRAT," _
''& "TRANSS_WEIGHT,TRANSS_RATETYPE,TRANSS_RATE,TRANSS_VALUE,TRANSS_VPG,TRANSS_SORT,TRANSS_ORATE)"_
''& "values(0,"& Val(adorsmaxid.Fields(0)&")+ 1&," _
''& " N +& Val(adorsmaxid.Fields(0)&")+ 1& ","N","_
''& "DateValue("& Trim(.TextMatrix(.Row,0))&"''),&英特诺& ," _
''& "和Val(Trim(.TextMatrix(.Row,10))&")& ," _
''& "和Val(Trim(.TextMatrix(.Row,12))&")& ," _
''& "和Val(Trim(.TextMatrix(.Row,4))&")& ," _
''& "和Format(Val(Trim(.TextMatrix(.Row,5))&"),#0.000")& ," _
''& "和Format(Val(Trim(.TextMatrix(.Row,6))&"),#0.000")& ," _
''& "& Mid(Trim(.TextMatrix(.Row,7)),1,1)& ","_
''& "和Format(Val(Trim(.TextMatrix(.Row,8))&"),#0.00")& ," _
''& "和Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
''& "和Format((Val(Trim(.TextMatrix(.Row,9))&")/Val(Trim(.TextMatrix(.Row,6))&")),#0.00")& ," _
''& " N,"和Mid(Trim(.TextMatrix(.Row,7)),1,1)& ")"
''''& Mid(Trim(.TextMatrix(.Row,7)),1,1)&''
''==============================
如果Val(Trim(.TextMatrix(.Row,14))&")= 0然后
如果adorsmaxid.State = 1,则adorsmaxid.Close
adorsmaxid.打开从SEVA_MAST选择最大(SEVA_ID)",g_adomast1,adOpenStatic,adLockReadOnly
g_adomast1.执行插入SEVA_MAST(SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT)" _
& "SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6," _
& "SEVA_SPLIT7,SEVA_SPLIT8,SEVA_SPLIT9,SEVA_SPLIT10" _
& "values(" S +& Val(adorsmaxid.Fields(0)&")+ 1&"'',"_
& "& Replace(Trim(.TextMatrix(.Row,0)),''","")& ","_
& "& Replace(Trim(.TextMatrix(.Row,1)),''","")& ","_
& "和Format(Val(Trim(.TextMatrix(.Row,2))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,3))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,4))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,5))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,6))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,7))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,8))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,10))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,11))&"),#0.00")& ," _
& "和Format(Val(Trim(.TextMatrix(.Row,12))&"),#0.00")& )"
其他
g_adomast1.执行更新SEVA_MAST集" _
& "SEVA_CODE ="& Mid(Trim(.TextMatrix(.Row,0)),8,8)& ","_
& "SEVA_NAME ="& Mid(Trim(.TextMatrix(.Row,1)),30,30)& ","_
& "SEVA_AMOUNT ="& Format(Val(Trim(.TextMatrix(.Row,2))&"),#0.00")& ," _
& "SEVA_SPLIT1 ="& Format(Val(Trim(.TextMatrix(.Row,3))&"),#0.00")& ," _
& "SEVA_SPLIT2 ="& Format(Val(Trim(.TextMatrix(.Row,4))&"),#0.00")& ," _
& "SEVA_SPLIT3 ="& Format(Val(Trim(.TextMatrix(.Row,5))&"),#0.000")& ," _
& "SEVA_SPLIT4 ="& Format(Val(Trim(.TextMatrix(.Row,6))&"),#0.000")& ," _
& "SEVA_SPLIT5 ="& Format(Val(Trim(.TextMatrix(.Row,7)),"),#0.00")& ," _
& "SEVA_SPLIT6 ="& Format(Val(Trim(.TextMatrix(.Row,8))&"),#0.00")& ," _
& "SEVA_SPLIT7 ="& Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
& "SEVA_SPLIT8 ="& Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
& "SEVA_SPLIT9 ="& Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
& "SEVA_SPLIT10 ="& Format(Val(Trim(.TextMatrix(.Row,9))&"),#0.00")& ," _
& 其中SEVA_ID ="& Val(Trim(.TextMatrix(.Row,14))&")& "
如果结束
g_adomast1.CommitTrans
结尾为
致电fill_vsflexseva

如果adorsmaxid.State = 1,则adorsmaxid.Close:设置adorsmaxid = Nothing
如果adorsseva.State = 1,则adorsseva.Close:设置adorsseva = Nothing
退出子
err_savestones:

g_adomast1.RollbackTrans
调用Error_Message("savestones")
退出子
上一个:
调用Error_Message("savestones")
结束Sub

Option Explicit
Dim mno As Integer ''Menu no for user rights

Private Sub Form_Load()
Call FormCenter(Me)
Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0

End Sub

Private Sub fill_vs()
On Error GoTo err_fill_vs
Dim inti As Integer
Dim adorsseva As New ADODB.Recordset

If adorsseva.State = 1 Then adorsseva.Close
adorsseva.Open "Select SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT,SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6,SEVA_SPLIT7,SEVA_SPLIT8,SEVA_SPLIT9,SEVA_SPLIT10 from SEVA_MAST order by SEVA_NAME", g_adomast1, adOpenStatic, adLockReadOnly
vsflexseva.Rows = 1
vsflexseva.Rows = 2
If adorsseva.EOF = False Then
For inti = 1 To adorsseva.RecordCount
vsflexseva.TextMatrix(inti, 0) = adorsseva!SEVA_CODE & ""
vsflexseva.TextMatrix(inti, 1) = adorsseva!SEVA_NAME & ""
vsflexseva.TextMatrix(inti, 2) = adorsseva!SEVA_AMOUNT & ""
vsflexseva.TextMatrix(inti, 3) = adorsseva!SEVA_SPLIT1 & ""
vsflexseva.TextMatrix(inti, 4) = adorsseva!SEVA_SPLIT2 & ""
vsflexseva.TextMatrix(inti, 5) = adorsseva!SEVA_SPLIT3 & ""
vsflexseva.TextMatrix(inti, 6) = adorsseva!SEVA_SPLIT4 & ""
vsflexseva.TextMatrix(inti, 7) = adorsseva!SEVA_SPLIT5 & ""
vsflexseva.TextMatrix(inti, 8) = adorsseva!SEVA_SPLIT6 & ""
vsflexseva.TextMatrix(inti, 9) = adorsseva!SEVA_SPLIT7 & ""
vsflexseva.TextMatrix(inti, 10) = adorsseva!SEVA_SPLIT8 & ""
vsflexseva.TextMatrix(inti, 11) = adorsseva!SEVA_SPLIT9 & ""
vsflexseva.TextMatrix(inti, 12) = adorsseva!SEVA_SPLIT10 & ""
vsflexseva.TextMatrix(inti, 14) = Val(adorsseva!SEVA_ID & "")
adorsseva.MoveNext
vsflexseva.Rows = vsflexseva.Rows + 1
Next
End If
If adorsseva.State = 1 Then adorsseva.Close: Set adorsseva = Nothing

Exit Sub
err_fill_vs:
Call Error_Message("fill_vs")
End Sub

''Private Sub vsflexseva_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
'''' If vsflexseva.Col = 0 Then ''code
'''' vsflexseva.EditMaxLength = 5
'''' End If
'''' If vsflexseva.Col = 1 Then ''seva name
'''' vsflexseva.EditMaxLength = 30
'''' End If
''End Sub

Private Sub vsflexseva_EnterCell()
vsflexseva.Cell(flexcpBackColor, vsflexseva.Row, 0, vsflexseva.Row, vsflexseva.Cols - 1) = &HD9B8E7 ''&HDDDAD2 ''&HFFC0C0
vsflexseva.Cell(flexcpForeColor, vsflexseva.Row, 0, vsflexseva.Row, vsflexseva.Cols - 1) = &H80000002

If vsflexseva.Col = 0 Then '' code
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva code OR Press [Esc] to quit"
End If
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If

If vsflexseva.Col = 1 Then '' seva name
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 2 Then '' rate
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 3 Then '' split1
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 4 Then '' split2
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 5 Then '' split3
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 6 Then '' split4
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 7 Then '' split5
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 8 Then '' split6
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 9 Then '' split7
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 10 Then '' split8
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 11 Then '' split9
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
If vsflexseva.Col = 12 Then '' split10
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") <> 0 Then
lblhelp.Caption = "[Shift]+[Delete] to delete the record OR press [Esc] to quit"
Else
lblhelp.Caption = "Enter seva Name OR press [Esc] to quit"
End If
vsflexseva.CellBackColor = vbWhite
vsflexseva.Editable = flexEDKbdMouse
vsflexseva.EditCell

Exit Sub
End If
End Sub

Private Sub vsflexseva_KeyDownEdit(ByVal Row As Long, ByVal Col As Long, KeyCode As Integer, ByVal Shift As Integer)
Dim adorscheck As New ADODB.Recordset
Dim adoRSdno As New ADODB.Recordset

If KeyCode = vbKeyReturn Or KeyCode = vbKeyRight Then
If vsflexseva.Col = 0 Then ''Code
vsflexseva.Col = 13
If Trim(vsflexseva.TextMatrix(vsflexseva.Row, 0)) = "" Then ''Code
vsflexseva.Col = 0
vsflexseva.EditCell
Else
If adorscheck.State = 1 Then adorscheck.Close
adorscheck.Open "Select STAFF_CODE from STAFFMAST_T where " _
& "STAFF_CODE = ''" & Trim(vsflexseva.TextMatrix(vsflexseva.Row, 0)) & "'' ", g_adomast1, adOpenStatic, adLockReadOnly
If adorscheck.EOF = False Then
MsgBox "Code cannot be duplicated...", vbInformation
vsflexseva.Col = 0
vsflexseva.EditCell
Exit Sub
End If
vsflexseva.Col = 1

vsflexseva.EditCell
End If
Exit Sub
End If

If vsflexseva.Col = 1 Then ''Name
vsflexseva.Col = 13
If Trim(vsflexseva.TextMatrix(vsflexseva.Row, 1)) = "" Then ''Staff Name
vsflexseva.Col = 1
vsflexseva.EditCell
Exit Sub
End If
If adorscheck.State = 1 Then adorscheck.Close
adorscheck.Open "Select SEVA_CODE from SEVA_MAST where " _
& "SEVA_CODE = ''" & Trim(vsflexseva.TextMatrix(vsflexseva.Row, 0)) & "'' and " _
& "SEVA_ID <> " & Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") & "", g_adomast1, adOpenStatic, adLockReadOnly
vsflexseva.Col = 2
vsflexseva.EditCell
If adorscheck.EOF = False Then
MsgBox "Code cannot be duplicated...", vbInformation
vsflexseva.Col = 0
vsflexseva.EditCell
Exit Sub
End If
If vsflexseva.Col = 2 Then
vsflexseva.Col = 3
Exit Sub
End If
If vsflexseva.Col = 3 Then
vsflexseva.Col = 4
Exit Sub
End If
If vsflexseva.Col = 4 Then
vsflexseva.Col = 5
Exit Sub
End If
If vsflexseva.Col = 5 Then
vsflexseva.Col = 6
Exit Sub
End If
If vsflexseva.Col = 6 Then
vsflexseva.Col = 7
Exit Sub
End If
If vsflexseva.Col = 7 Then
vsflexseva.Col = 8
Exit Sub
End If
If vsflexseva.Col = 8 Then
vsflexseva.Col = 9
Exit Sub
End If
If vsflexseva.Col = 9 Then
vsflexseva.Col = 10
Exit Sub
End If
If vsflexseva.Col = 10 Then
vsflexseva.Col = 11
Exit Sub
End If
If vsflexseva.Col = 11 Then
vsflexseva.Col = 12
Exit Sub
End If
If vsflexseva.Col = 12 Then
Call saveseva
Exit Sub
End If
On Error GoTo err_vsflexseva_KeyDownEdit
g_adomast1.BeginTrans

''Inserting into sevamast
If Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") = 0 Then

Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0: vsflexseva.EditCell
Exit Sub

If adoRSdno.State = 1 Then adoRSdno.Close
adoRSdno.Open "Select max(SEVA_ID) from SEVA_MAST", g_adomast1, adOpenStatic, adLockReadOnly
g_adomast1.Execute "Insert into SEVA_MAST (SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT,SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6,SEVA_SPLIT7,SEVA_SPLIT8,SEVA_SPLIT9,SEVA_SPLIT10) " _
& "values (" & Val(adoRSdno.Fields(0) & "") + 1 & ",''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 0)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 1)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 2)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 3)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 4)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 5)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 6)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 7)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 8)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 9)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 10)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 11)), "''", """") & "''," _
& "''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 12)), "''", """") & "'')"

If adoRSdno.State = 1 Then adoRSdno.Close: Set adoRSdno = Nothing
Else
''Updating SEVA_MAST

Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0: vsflexseva.EditCell
Exit Sub

g_adomast1.Execute "Update SEVA_MAST set SEVA_NAME = ''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 1)), "''", """") & "'', SEVA_CODE = ''" & Replace(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 0)), "''", """") & "'' where SEVA_ID = " & Val(Trim(vsflexseva.TextMatrix(vsflexseva.Row, 14)) & "") & ""

End If
g_adomast1.CommitTrans

On Error GoTo last
Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0
vsflexseva.EditCell

End If
End If

If KeyCode = vbKeyDelete And Shift = 1 Then
Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0: vsflexseva.EditCell
Exit Sub

Dim adoRSdel As New ADODB.Recordset
If adoRSdel.State = 1 Then adoRSdel.Close
adoRSdel.Open "Select SEVA_ID from SEVA_MAST where SEVA_ID = " & Val(Trim(Val(vsflexseva.TextMatrix(vsflexseva.Row, 2))) & "") & "", g_adomast1, adOpenStatic, adLockReadOnly
If adoRSdel.EOF = False Then
MsgBox "Cannot Delete....Already in Use", vbCritical
vsflexseva.Col = 0
Exit Sub
End If
If MsgBox("Do you really want to delete the entry?", vbYesNo + vbDefaultButton2) = vbYes Then
g_adomast1.Execute "Delete from SEVA_MAST where SEVA_ID = " & Val(Trim(Val(vsflexseva.TextMatrix(vsflexseva.Row, 14))) & "") & ";"

End If

Call fill_vs
vsflexseva.Row = vsflexseva.Rows - 1
vsflexseva.Col = 0

vsflexseva.EditCell
Exit Sub
End If

If KeyCode = vbKeyEscape Then
Unload Me
End If

Exit Sub
last:
Call Error_Message("vsflexseva_KeyDownEdit")
Exit Sub
err_vsflexseva_KeyDown
g_adomast1.RollbackTrans

Call Error_Message("vsflexseva_KeyDownEdit")
End Sub

Private Sub vsflexseva_KeyPressEdit(ByVal Row As Long, ByVal Col As Long, KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub vsflexseva_LeaveCell()
If vsflexseva.Row = 0 Then Exit Sub
vsflexseva.Cell(flexcpBackColor, vsflexseva.Row, 0, vsflexseva.Row, vsflexseva.Cols - 1) = &HFFFFFF ''&HFFF2FE
vsflexseva.Cell(flexcpForeColor, vsflexseva.Row, 0, vsflexseva.Row, vsflexseva.Cols - 1) = vbBlack
End Sub

Private Sub saveseva()
Dim adorsmaxid As New ADODB.Recordset
Dim adorsseva As New ADODB.Recordset
Dim intno As Integer: intno = 0
On Error GoTo last


On Error GoTo err_savestones
With vsflexseva
g_adomast1.BeginTrans
''===============================

'' If Val(Trim(.TextMatrix(.Row, 14)) & "") = 0 Then
'' If adorsmaxid.State = 1 Then adorsmaxid.Close
'' adorsmaxid.Open "Select max(TRANS_ID) from STSTOCKMASTER_T where TRANSS_TYPE = ''N''", g_adomast1, adOpenStatic, adLockReadOnly
'' g_adomast1.Execute "Insert into STSTOCKMASTER_T(TRANSS_SLNO,TRANS_ID,TRANSS_SID,TRANSS_TYPE," _
'' & "TRANSS_DATE,TRANSS_PNO,TRANSS_STONENO,TRANSS_MINES,TRANSS_QTY,TRANSS_CARRAT," _
'' & "TRANSS_WEIGHT,TRANSS_RATETYPE,TRANSS_RATE,TRANSS_VALUE,TRANSS_VPG,TRANSS_SORT,TRANSS_ORATE)" _
'' & "values(0," & Val(adorsmaxid.Fields(0) & "") + 1 & "," _
'' & "''N+" & Val(adorsmaxid.Fields(0) & "") + 1 & "'',''N''," _
'' & "DateValue(''" & Trim(.TextMatrix(.Row, 0)) & "'')," & intno & "," _
'' & "" & Val(Trim(.TextMatrix(.Row, 10)) & "") & "," _
'' & "" & Val(Trim(.TextMatrix(.Row, 12)) & "") & "," _
'' & "" & Val(Trim(.TextMatrix(.Row, 4)) & "") & "," _
'' & "" & Format(Val(Trim(.TextMatrix(.Row, 5)) & ""), "#0.000") & "," _
'' & "" & Format(Val(Trim(.TextMatrix(.Row, 6)) & ""), "#0.000") & "," _
'' & "''" & Mid(Trim(.TextMatrix(.Row, 7)), 1, 1) & "''," _
'' & "" & Format(Val(Trim(.TextMatrix(.Row, 8)) & ""), "#0.00") & "," _
'' & "" & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
'' & "" & Format((Val(Trim(.TextMatrix(.Row, 9)) & "") / Val(Trim(.TextMatrix(.Row, 6)) & "")), "#0.00") & "," _
'' & "''N'',''" & Mid(Trim(.TextMatrix(.Row, 7)), 1, 1) & "'')"
'' ''" & Mid(Trim(.TextMatrix(.Row, 7)), 1, 1) & "''
''===============================
If Val(Trim(.TextMatrix(.Row, 14)) & "") = 0 Then
If adorsmaxid.State = 1 Then adorsmaxid.Close
adorsmaxid.Open "Select max(SEVA_ID) from SEVA_MAST ", g_adomast1, adOpenStatic, adLockReadOnly
g_adomast1.Execute "Insert into SEVA_MAST(SEVA_ID,SEVA_CODE,SEVA_NAME,SEVA_AMOUNT," _
& "SEVA_SPLIT1,SEVA_SPLIT2,SEVA_SPLIT3,SEVA_SPLIT4,SEVA_SPLIT5,SEVA_SPLIT6," _
& "SEVA_SPLIT7,SEVA_SPLIT8,SEVA_SPLIT9,SEVA_SPLIT10" _
& "values(''S+" & Val(adorsmaxid.Fields(0) & "") + 1 & "''," _
& "''" & Replace(Trim(.TextMatrix(.Row, 0)), "''", """") & "''," _
& "''" & Replace(Trim(.TextMatrix(.Row, 1)), "''", """") & "''," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 2)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 3)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 4)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 5)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 6)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 7)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 8)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 10)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 11)) & ""), "#0.00") & "," _
& "" & Format(Val(Trim(.TextMatrix(.Row, 12)) & ""), "#0.00") & ")"
Else
g_adomast1.Execute "Update SEVA_MAST set " _
& "SEVA_CODE =''" & Mid(Trim(.TextMatrix(.Row, 0)), 8, 8) & "''," _
& "SEVA_NAME = ''" & Mid(Trim(.TextMatrix(.Row, 1)), 30, 30) & "''," _
& "SEVA_AMOUNT = " & Format(Val(Trim(.TextMatrix(.Row, 2)) & ""), "#0.00") & "," _
& "SEVA_SPLIT1 = " & Format(Val(Trim(.TextMatrix(.Row, 3)) & ""), "#0.00") & "," _
& "SEVA_SPLIT2 = " & Format(Val(Trim(.TextMatrix(.Row, 4)) & ""), "#0.00") & "," _
& "SEVA_SPLIT3 = " & Format(Val(Trim(.TextMatrix(.Row, 5)) & ""), "#0.000") & " ," _
& "SEVA_SPLIT4 = " & Format(Val(Trim(.TextMatrix(.Row, 6)) & ""), "#0.000") & "," _
& "SEVA_SPLIT5 = " & Format(Val(Trim(.TextMatrix(.Row, 7)), ""), "#0.00") & "," _
& "SEVA_SPLIT6 = " & Format(Val(Trim(.TextMatrix(.Row, 8)) & ""), "#0.00") & "," _
& "SEVA_SPLIT7 = " & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
& "SEVA_SPLIT8 = " & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
& "SEVA_SPLIT9 = " & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
& "SEVA_SPLIT10 = " & Format(Val(Trim(.TextMatrix(.Row, 9)) & ""), "#0.00") & "," _
& "where SEVA_ID = " & Val(Trim(.TextMatrix(.Row, 14)) & "") & " "
End If
g_adomast1.CommitTrans
End With
Call fill_vsflexseva

If adorsmaxid.State = 1 Then adorsmaxid.Close: Set adorsmaxid = Nothing
If adorsseva.State = 1 Then adorsseva.Close: Set adorsseva = Nothing
Exit Sub
err_savestones:

g_adomast1.RollbackTrans
Call Error_Message("savestones")
Exit Sub
last:
Call Error_Message("savestones")
End Sub

推荐答案


这篇关于任何人都可以调试此代码中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 14:23