以下是引用片段:
实现功能的关键代码为: Private Sub MMButton_XPBE1_Click(Index As Integer) '删除当前的社区 Dim strresult As String If Trim(ddd.TextMatrix(ddd.Row, 1)) = "" Then Exit Sub strresult = Exec_SqL("delete from sqxx where sqdm='" & Trim(ddd.TextMatrix(ddd.Row, 1)) & "'") If strresult <> "OK" Then log = InsertOperateLog("删除社区信息", "失败") MsgBox strresult Exit Sub End If log = InsertOperateLog("删除社区信息", "成功") Call frmSQWH.UpdateList End Sub
Public Sub UpdateList() '设置表格的标头和样式 '动态从数据库中装载数据 '1 Dim arrName() arrName = Array("idkey", "社区代码", "社区名称", "备注") Dim arrColwidth() arrColwidth = Array(0, 1000, 2000, 4000) ddd.Cols = 4 ddd.Rows = 2 Dim i As Long For i = 0 To ddd.Cols - 1 ddd.ColWidth(i) = arrColwidth(i) ddd.TextMatrix(0, i) = arrName(i) ddd.TextMatrix(1, i) = "" Next ddd.Rows = 20 Call UpdateDDD(ddd, ExecSql("select idkey, sqdm, sqmc, sqbz" _ & " from sqxx order by sqdm")) End Sub
|