📄 frm设备检修.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm设备检修
Caption = "调度月报 ----设备检修"
ClientHeight = 5175
ClientLeft = 60
ClientTop = 345
ClientWidth = 8490
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5175
ScaleWidth = 8490
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 3720
TabIndex = 13
Top = 4560
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frm设备检修.frx":0000
Height = 2895
Left = 120
TabIndex = 12
Top = 1560
Width = 8295
_ExtentX = 14631
_ExtentY = 5106
_Version = 393216
BackColor = 8454016
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
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
Begin VB.TextBox Text4
BackColor = &H00C0C0C0&
Height = 375
Left = 7320
TabIndex = 11
Top = 850
Width = 850
End
Begin VB.TextBox Text3
BackColor = &H00C0C0C0&
Height = 375
Left = 5280
TabIndex = 9
Top = 850
Width = 850
End
Begin VB.TextBox Text2
BackColor = &H00C0C0C0&
Height = 375
Left = 3240
TabIndex = 7
Top = 850
Width = 850
End
Begin VB.TextBox Text1
BackColor = &H00C0C0C0&
Height = 375
Left = 1200
TabIndex = 5
Top = 850
Width = 850
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1200
TabIndex = 3
Text = "Combo1"
Top = 300
Width = 1215
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 6120
TabIndex = 0
Top = 240
Width = 1455
_ExtentX = 2566
_ExtentY = 661
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CustomFormat = "yyyy-MM"
Format = 61145091
UpDown = -1 'True
CurrentDate = 37918
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 3840
Top = 3480
Width = 1575
_ExtentX = 2778
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label6
Caption = "合 计"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6360
TabIndex = 10
Top = 940
Width = 735
End
Begin VB.Label Label5
Caption = "事 故"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4320
TabIndex = 8
Top = 940
Width = 735
End
Begin VB.Label Label4
Caption = "临 检"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2280
TabIndex = 6
Top = 940
Width = 735
End
Begin VB.Label Label3
Caption = "计 划"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 4
Top = 940
Width = 735
End
Begin VB.Label Label2
Caption = "单 位"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 2
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "时 间"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4800
TabIndex = 1
Top = 360
Width = 735
End
End
Attribute VB_Name = "frm设备检修"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
Call Open_link
sql1 = "select * from xdgl_ddyb_sbjx where rq='" & DTPicker1.Value & "' and dw='" & Trim(Combo1.Text) & "'"
Set RS = ZHCX.Execute(sql1, 0)
If RS.EOF Then
sql1 = "insert xdgl_ddyb_sbjx (rq,dw,jh,lj,sg,hj) values('" & DTPicker1.Value & "','" & Trim(Combo1.Text) & "','" & Trim(Text1.Text) & "'," & Trim(Text2.Text) & "," & Trim(Text3.Text) & "," & Trim(Text4.Text) & ")"
Else
sql1 = "update xdgl_ddyb_sbjx set dw='" & Trim(Combo1.Text) & "',jh=" & Text1.Text & ",lj=" & Text2.Text & ",sg=" & Text3.Text & ",hj=" & Text4.Text & " where rq='" & DTPicker1.Value & "' and dw='" & Trim(Combo1.Text) & "'"
End If
If RS.State Then
RS.Close
End If
Set RS = ZHCX.Execute(sql1, 0)
If RS.State Then
RS.Close
End If
Call Close_link
Adodc1.Refresh
Call sx
End Sub
Private Sub DTPicker1_Change()
Adodc1.RecordSource = "select * from xdgl_ddyb_sbjx where rq='" & DTPicker1.Value & "' "
Adodc1.Refresh
Call sx
End Sub
Private Sub DTPicker1_Click()
Adodc1.RecordSource = "select * from xdgl_ddyb_sbjx where rq='" & DTPicker1.Value & "' "
Adodc1.Refresh
Call sx
End Sub
Private Sub Form_Load()
On Error Resume Next
DTPicker1.Value = Format(Now, "yyyy-mm-01")
Adodc1.ConnectionString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
Adodc1.RecordSource = "select * from xdgl_ddyb_sbjx where rq='" & DTPicker1.Value & "' "
sql1 = "select jlgk from xdgl_jsb where type='县属'"
Call Open_link
Combo1.Clear
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo1.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Call Close_link
Adodc1.Refresh
Call sx
End Sub
Sub sx()
DataGrid1.Columns(0).Visible = False
DataGrid1.Columns(1).Caption = " 单 位"
DataGrid1.Columns(1).Width = 1500
DataGrid1.Columns(2).Caption = " 计 划"
DataGrid1.Columns(2).Width = 1500
DataGrid1.Columns(3).Caption = " 临 检"
DataGrid1.Columns(3).Width = 1500
DataGrid1.Columns(4).Caption = " 事 故"
DataGrid1.Columns(4).Width = 1500
DataGrid1.Columns(5).Caption = " 合 计"
DataGrid1.Columns(5).Width = 1500
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If Index = 0 Then
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If Index = 0 Then
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
Else
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If Index = 0 Then
If KeyCode = 13 Then
Text4.SetFocus
Else
End If
Else
End If
End Sub
Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
If Index = 0 Then
If KeyCode = 13 Then
Command1.SetFocus
Else
End If
Else
End If
End Sub
Private Sub Text1_LostFocus()
On Error Resume Next
Text4.Text = CDbl(Text1.Text) + CDbl(Text2.Text) + CDbl(Text3.Text)
End Sub
Private Sub Text2_LostFocus()
On Error Resume Next
Text4.Text = CDbl(Text1.Text) + CDbl(Text2.Text) + CDbl(Text3.Text)
End Sub
Private Sub Text3_LostFocus()
On Error Resume Next
Text4.Text = CDbl(Text1.Text) + CDbl(Text2.Text) + CDbl(Text3.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -