📄 frmsgcl.frm
字号:
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmSGCL.frx":003C
Height = 1455
Left = -74880
TabIndex = 21
Top = 2400
Width = 7575
_ExtentX = 13361
_ExtentY = 2566
_Version = 393216
HeadLines = 1
RowHeight = 14
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Label Label6
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 255
Left = 480
TabIndex = 3
Top = 5760
Width = 3495
End
Begin VB.Label Lable
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "事故记录"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 2
Top = 240
Width = 8655
End
End
End
Attribute VB_Name = "FrmSGCL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim PBH As Integer
Dim flag As Boolean
Private Sub SBBH_Change()
End Sub
Private Sub BC_Change()
CMDSave.Enabled = True
End Sub
Private Sub Check1_Click()
List1.Visible = False
Text13.Visible = False
List1.Clear
If Check1.Value = 1 Then
Check1.Value = 1
List1.Visible = True
Text13.Visible = True
SQL = "select distinct 记录人 from 事故记录"
Set rs = ConnWZ.Execute(SQL)
Do While Not rs.EOF
List1.AddItem rs("记录人")
rs.MoveNext
Loop
End If
End Sub
Private Sub cmdCancel_Click()
SBGCGL.Enabled = True
Unload Me
End Sub
Private Sub CMDDel_Click()
Result = MsgBox("您确实要删除吗?", vbYesNo)
If Result = 6 Then
SQL = "delete 事故记录 where 序号=" & PBH & ""
Set rs = ConnWZ.Execute(SQL)
PBH = 0
Else
Exit Sub
End If
End Sub
Private Sub cmdEdit_Click()
CMDSave.Enabled = True
flag = True
JLR.Locked = False
JYSM.Locked = False
CLQK.Locked = False
End Sub
Private Sub CMDFresh_Click()
PBH = 0
JLR = ""
JYSM = ""
CLQK = ""
RQ.Value = Date
JLR.Locked = False
JYSM.Locked = False
CLQK.Locked = False
CMDSave.Enabled = False
CMDDel.Enabled = False
cmdEdit.Enabled = False
flag = False
End Sub
Private Sub CMDSave_Click()
If flag = False Then
Result = MsgBox("您确实要保存吗?", vbYesNo)
If Result = 6 Then
SQL = "insert 事故记录(日期,记录人,事故简要说明,处理情况) values ('" & RQ & "','" & JLR & "','" & JYSM & "','" & CLQK & "')"
Set rs = ConnWZ.Execute(SQL)
End If
End If
If flag = True Then
Result = MsgBox("您确实要保存吗?", vbYesNo)
If Result = 6 Then
SQL = "update 事故记录 set 日期='" & RQ & "',记录人='" & JLR & "',事故简要说明='" & JYSM & "',处理情况='" & CLQK & "' where 序号=" & PBH & ""
Set Rsrkpd = ConnWZ.Execute(SQL)
CMDSave.Enabled = False
End If
End If
End Sub
Private Sub CMDSearch_Click()
If Text13.Text = "" Then
MsgBox "记录人不能为空!"
Exit Sub
End If
If Check1.Value = 1 Then
Adodc1.RecordSource = "select * from 事故记录 where 记录人='" & Text13.Text & "'"
Adodc1.Refresh
End If
End Sub
Private Sub DataGrid1_Click()
On Error Resume Next
SQL = "select * from 事故记录"
Set rs = ConnWZ.Execute(SQL)
If rs.EOF Then Exit Sub
PBH = Adodc1.Recordset.Fields("序号")
If Err = 13 Then
MsgBox "您进行了误操作,请重新进入该系统!"
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋体"
TextBox.Font.Size = 9
Next
PBH = 0
flag = False
'SJ.Value = Time$
'RQ.Value = Date
CMDSave.Enabled = False
cmdEdit.Enabled = False
CMDDel.Enabled = False
Label6.Caption = Now
'Combo1.Visible = False
'Frame8.Visible = False
End Sub
Private Sub JLR_Change()
CMDSave.Enabled = True
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
flag = False
If PreviousTab = 0 Then
Check1.Value = 0
CMDSave.Enabled = False
cmdEdit.Enabled = False
CMDDel.Enabled = False
Adodc1.RecordSource = "select * from 事故记录"
Adodc1.Refresh
End If
If PreviousTab = 1 Then
Text13.Visible = False
List1.Visible = False
' Frame8.Visible = False
' Combo1.Visible = False
If PBH <> "0" Then
SQL = "select * from 事故记录 where 序号=" & PBH & ""
Set rs = ConnWZ.Execute(SQL)
RQ.Value = rs("日期")
JLR = rs("记录人")
JYSM = rs("事故简要说明")
CLQK = rs("处理情况")
JLR.Locked = True
JYSM.Locked = True
CLQK.Locked = True
CMDSave.Enabled = False
cmdEdit.Enabled = True
CMDDel.Enabled = True
End If
End If
End Sub
Private Sub Timer1_Timer()
Label6.Caption = Now
End Sub
Private Sub List1_MouseDown(Button As Integer, shift As Integer, X As Single, Y As Single)
i = List1.ListIndex
Text13 = List1.List(i)
End Sub
Private Sub Text13_Change()
Str1 = Text13.Text
Cont = Len(Str1)
For i = 0 To List1.ListCount - 1
If Left$(List1.List(i), Cont) = Str1 Then
List1.ListIndex = i
GoTo 100
End If
Next
100:
End Sub
Private Sub XHDE_LostFocus()
If IsNumeric(XHDE) = False Then
MsgBox "请输入数字!"
XHDE = ""
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -