📄 frmsetsect.frm
字号:
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form FrmSetSect
Caption = "区域设置"
ClientHeight = 4425
ClientLeft = 870
ClientTop = 1740
ClientWidth = 8265
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 4425
ScaleWidth = 8265
Begin MSDBGrid.DBGrid DBGrid1
Bindings = "FrmSetSect.frx":0000
Height = 4215
Left = 4080
OleObjectBlob = "FrmSetSect.frx":0014
TabIndex = 5
Top = 120
Width = 4095
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\ICLock\Lock312\ICData.mdb"
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 2520
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Sect"
Top = 120
Visible = 0 'False
Width = 1695
End
Begin VB.TextBox TxtNotes
Height = 2415
Left = 960
MultiLine = -1 'True
TabIndex = 1
Top = 1440
Width = 1575
End
Begin VB.TextBox TxtSectNumber
Height = 375
Left = 960
TabIndex = 0
Top = 600
Width = 1575
End
Begin VB.CommandButton CmdAdd
Caption = "添加"
Height = 375
Left = 2760
TabIndex = 2
Top = 1440
Width = 1095
End
Begin VB.CommandButton CmdDelete
Caption = "删除"
Height = 375
Left = 2760
TabIndex = 3
Top = 2160
Width = 1095
End
Begin VB.CommandButton CmdCancel
Caption = "取消"
Height = 375
Left = 2760
TabIndex = 4
Top = 2880
Width = 1095
End
Begin VB.Label Label1
Caption = "说明:区域输入数字"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 8
Top = 4080
Width = 2415
End
Begin VB.Line Line1
X1 = 2640
X2 = 2640
Y1 = 600
Y2 = 4080
End
Begin VB.Label Label3
Caption = "描述"
Height = 375
Left = 240
TabIndex = 7
Top = 1440
Width = 615
End
Begin VB.Label Label2
Caption = "区域(01)"
Height = 375
Left = 120
TabIndex = 6
Top = 600
Width = 855
End
End
Attribute VB_Name = "FrmSetSect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim tRoomNumber As String
'对RC_Room删除房间记录
Function RC_Sect_Del(ByVal pSectNumber As String) As Boolean
Dim sTmp As String
On Error GoTo ErrHand:
sTmp = "SectNumber='" & pSectNumber & "'"
With RC_Sect
If Not (.BOF And .EOF) Then
.MoveFirst
.FindLast sTmp
If Not .NoMatch Then
.Delete
RC_Sect_Del = True
Exit Function
End If
End If
End With
RC_Sect_Del = False
Exit Function
ErrHand:
RC_Sect_Del = False
End Function
Private Sub CmdAdd_Click()
Dim sTmp, sTmp1 As String
If TxtSectNumber.Text = "" Then
MsgBox "区域非空", vbInformation + vbOKOnly, "提示"
Exit Sub
End If
If TxtNotes.Text = "" Then
sTmp1 = "NO"
Else
sTmp1 = TxtNotes.Text
End If
sTmp = "SectNumber='" & TxtSectNumber.Text & "'"
With RC_Sect
If Not (.BOF And .EOF) Then
.MoveFirst
.FindLast sTmp
If Not .NoMatch Then
MsgBox "区域" & TxtSectNumber.Text & "存在", vbInformation + vbOKOnly, "提示"
Exit Sub
End If
End If
.AddNew
.Fields("SectNumber") = TxtSectNumber.Text
.Fields("Notes") = sTmp1
.Update
Call RC_EventLog_Add("添加区域" & TxtSectNumber.Text, gUserName, "")
Data1.Refresh
TxtSectNumber.Text = ""
TxtNotes.Text = ""
End With
End Sub
Private Sub CmdCancel_Click()
Unload Me
End Sub
Private Sub CmdDelete_Click()
If tRoomNumber = "" Then
MsgBox "无可删除项!", vbInformation + vbOKOnly, "提示"
Else
If RC_Sect_Del(tRoomNumber) Then
Data1.Refresh
Call RC_EventLog_Add("删除区域" & tRoomNumber, gUserName, "")
End If
End If
End Sub
Private Sub DBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
tRoomNumber = DBGrid1.Columns(0)
If tRoomNumber = "" Then
CmdDelete.Enabled = False
Else
CmdDelete.Enabled = True
End If
End Sub
Private Sub Form_Load()
Data1.DatabaseName = SystemDir & "ICData.mdb"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -