以下是引用片段:
Private Sub addData() '存储菜单主信息 '存储商品信息 '1 Call Exec_SqL("delete from cgdj where cgid='" & Me.Text2.Text & "'") Call Exec_SqL("delete from cgmx where cgid='" & Me.Text2.Text & "'") Call Exec_SqL("insert into cgdj (cgid,khmc,cgrq,zsl,zje,jlr,bz) " _ & " values('" & Me.Text2.Text & "','" & Trim(Me.Text3.Text) & "'," _ & "'" & Me.DTPicker1.Value & "'," & Val(Me.Text7.Text) & ", " _ & " " & Val(Me.Text6.Text) & ",'" & strRyName & "','" & Me.Text1.Text & "')") Dim i As Long '2 For i = 1 To ddd.Rows - 1 If ddd.TextMatrix(i, 0) <> "" Then Call Exec_SqL("insert into cgmx (cgid,spid,sl,je) values('" & Me.Text2.Text & "'," _ & " '" & Trim(ddd.TextMatrix(i, 0)) & "'," & Val(ddd.TextMatrix(i, ddd.Cols - 2)) & "," & Val(ddd.TextMatrix(i, ddd.Cols - 1)) & ")") Dim strresult As String strresult = UpdateKcmm(Trim(ddd.TextMatrix(i, 0)), "+", Val(ddd.TextMatrix(i, ddd.Cols - 2)), Val(ddd.TextMatrix(i, ddd.Cols - 1)), "") If strresult <> "OK" Then MsgBox strresult Exit Sub End If End If Next End Sub
|