以下是引用片段:
Private Sub btn添加_Click() '1.判断当前的人员在权限列表中是否有记录,如果有修改权限,没有,添加记录 Dim strkey As String If Me.TreeView1.SelectedItem.Key = "" Then Exit Sub If Me.TreeView1.SelectedItem.Key = "All" Then Exit Sub strkey = Mid(Me.TreeView1.SelectedItem.Key, 2, Len(Me.TreeView1.SelectedItem.Key) - 1) If ExecSql("select * from qx where ryid='" & strkey & "'").RecordCount > 0 Then Call Exec_SqL("update qx set jcsjsz=" & Me.Check1(0).Value & ",dcgl=" & Me.Check1(1).Value & ",cxtj=" & Me.Check1(2).Value & ",qxgl=" & Me.Check1(3).Value & " where ryid='" & strkey & "' ") Else Call Exec_SqL("insert into qx (ryid,jcsjsz,dcgl,cxtj,qxgl,pas) values ('" & strkey & "'," _ & " " & Me.Check1(0).Value & "," & Me.Check1(1).Value & "," & Me.Check1(2).Value & "," & Me.Check1(3).Value & ",'" & Trim(Me.Text1.Text) & "')") End If End Sub
|