End Sub
Private Sub renovate_Click()
Call callmain
End Sub
Private Sub XPButton1_Click()
kssave = True
Set ks1 = cnn.Execute("select * from " & kstable)
Grid1.Rows = 1 '清除所有记录
Grid1.Rows = 21 '默认为2行
Grid1.Column(1).CellType = cellCalendar
For i = 0 To 1 '显示数据的字段名
Grid1.Cell(0, i + 1).Text = ks1.Fields(i).Name '读取表中的各字段名
Next
Grid1.Column(1).Locked = False
Grid1.Cell(1, 1).SetFocus
XPButton2.Default = True
End Sub
Private Sub XPButton3_Click()
If ksdel = False Then
MsgBox "当前删除操作不被允许!", vbInformation, "非使用对象"
Exit Sub
End If
If hang = 0 Then
Exit Sub
End If
If Grid1.Cell(hang, 1).Text = "" Then
Exit Sub
End If
Set ks1 = cnn.Execute("delete from " & kstable & " where " & ks1.Fields(0).Name & "='" & Grid1.Cell(hang, 1).Text & "' and " & ks1.Fields(1).Name & "='" & Grid1.Cell(hang, 2).Text & "'")
MsgBox "目标己删除,请刷新数据!", vbInformation, "删除成功"
Call callmain
End Sub
Private Sub XPButton5_Click()
Unload Me
End Sub
Dim i As Integer
Private Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Integer
Dim gcolor1, gcolor2 As String
Dim m, n As Integer
Private Sub Form_Load()
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '进行注册
With Grid1
.AllowUserResizing = True
.ScrollBarStyle = Flat
.DefaultFont.Name = "Tahoma"
.BackColor1 = RGB(231, 235, 247)
.BackColor2 = RGB(239, 243, 255)
.GridColor = RGB(148, 190, 231)
.Column(0).Width = 0
.Column(1).Width = 100
Private Sub XPButton2_Click()
If kssave = False Then
MsgBox "不支持保存操作!", vbInformation, "当前不支持"
Exit Sub
End If
If m <> 0 And n <> 0 Then
Grid1.Range(m, 1, m, 1).BackColor = gcolor1
Grid1.Range(n, 1, n, 1).BackColor = gcolor2
End If
For i = 1 To Grid1.Rows - 1
For j = i + 1 To Grid1.Rows - 1
If Grid1.Cell(i, 1).Text <> "" Then
If Grid1.Cell(i, 1).Text = Grid1.Cell(j, 1).Text Then
MsgBox "第" & i & "行与" & j & "行的数据出现重复,请修改!", vbInformation, "重复错误"
m = i
n = j
gcolor1 = Grid1.Cell(m, 1).BackColor
gcolor2 = Grid1.Cell(n, 1).BackColor
Grid1.Range(i, 1, i, 1).BackColor = RGB(90, 158, 214)
Grid1.Range(j, 1, j, 1).BackColor = RGB(90, 158, 214)
Exit Sub
End If
End If
Next
Next
MsgBox "第" & i & "行的教室号已存在,系统自动跳过!", vbInformation, "提示"
End If
End If
Next
MsgBox "资料已保存!", vbInformation, "完成"
Call callmain
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9]