Private Sub Text1_Change(Index As Integer) '判断输入是否为空
If Trim(Text1(0)) = "" Or Trim(Text1(1)) = "" Then
cmdADD.Enabled = False
CmdDel.Enabled = False
Else
If pd = 1 Then
CmdDel.Enabled = True
Else
cmdADD.Enabled = True
CmdDel.Enabled = True
End If
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
If Text1(Index).TabStop = True Then
Text1(Index).BackColor = &HC0FFFF
Text1(Index).SelStart = 0
Text1(Index).SelLength = 12
End If
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &HFFC0C0
End Sub
Private Sub pdd() '判断数据库中是否有记录
operater.RecordSource = "select * from operater"
operater.Refresh
datacount = operater.Recordset.RecordCount
If datacount = 0 Then
List.Enabled = False
Else
List.Enabled = True
End If
End Sub
Private Sub flash() '刷新列表
Dim roww As Integer ''行
roww = 1
List.Clear
List.rows = 1
Call csf
operater.RecordSource = "operater"
operater.Refresh
operater.Recordset.MoveFirst
Do While operater.Recordset.EOF = False
List.rows = List.rows + 1
List.TextMatrix(roww, 0) = operater.Recordset.Fields(0)
List.TextMatrix(roww, 1) = operater.Recordset.Fields(1)
List.TextMatrix(roww, 2) = operater.Recordset.Fields(2)
roww = roww + 1
operater.Recordset.MoveNext
Loop
End Sub
Private Sub csf() '列表初始化
List.TextMatrix(0, 0) = "姓名"
List.TextMatrix(0, 1) = "密码"
List.TextMatrix(0, 2) = "权限"
List.ColWidth(0) = 1500
List.ColWidth(1) = 2500
List.ColWidth(2) = 1000
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9]