📄 form2.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form Form2
BorderStyle = 3 'Fixed Dialog
ClientHeight = 6000
ClientLeft = 45
ClientTop = 435
ClientWidth = 3870
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6000
ScaleWidth = 3870
ShowInTaskbar = 0 'False
Begin VB.ComboBox Combo1
Height = 300
Index = 1
Left = 1440
TabIndex = 15
Text = "Combo1"
Top = 720
Width = 2055
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 255
Left = 1320
TabIndex = 14
Top = 5040
Width = 2175
_ExtentX = 3836
_ExtentY = 450
_Version = 393216
Format = 25296897
CurrentDate = 39254
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 13
Top = 5520
Width = 855
End
Begin VB.CommandButton Command1
Caption = "保存"
Default = -1 'True
Height = 375
Left = 1560
TabIndex = 12
Top = 5520
Width = 855
End
Begin VB.TextBox Text4
Height = 270
Left = 1320
TabIndex = 10
Text = "Text4"
Top = 4635
Width = 2175
End
Begin VB.TextBox Text3
Height = 735
Left = 480
TabIndex = 8
Text = "Text3"
Top = 3600
Width = 3015
End
Begin VB.TextBox Text2
Height = 855
Left = 480
TabIndex = 6
Text = "Text2"
Top = 2160
Width = 3015
End
Begin VB.TextBox Text1
Height = 270
Left = 1440
TabIndex = 4
Text = "Text1"
Top = 1320
Width = 2055
End
Begin VB.ComboBox Combo1
Height = 300
Index = 0
Left = 1440
TabIndex = 2
Text = "Combo1"
Top = 240
Width = 2055
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "维修日期:"
Height = 180
Left = 240
TabIndex = 11
Top = 5040
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "维修人:"
Height = 180
Left = 420
TabIndex = 9
Top = 4680
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "故障原因:"
Height = 180
Left = 480
TabIndex = 7
Top = 3240
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "维修方法:"
Height = 180
Left = 360
TabIndex = 5
Top = 1800
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "机型:"
Height = 180
Index = 0
Left = 720
TabIndex = 3
Top = 300
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "故障代码:"
Height = 180
Index = 3
Left = 360
TabIndex = 1
Top = 840
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "故障描述:"
Height = 180
Index = 2
Left = 360
TabIndex = 0
Top = 1365
Width = 900
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Call gy_load
rs_c.Open "select * from 录入表", cn_c, adOpenKeyset, adLockOptimistic
rs_c.AddNew
rs_c.Fields(0) = Combo1.Text
rs_c.Fields(1) = Combo2.Text
rs_c.Fields(2) = Text1.Text
rs_c.Fields(3) = Text2.Text
rs_c.Fields(4) = Text3.Text
rs_c.Fields(5) = Text4.Text
rs_c.Fields(6) = DTPicker1
rs_c.Update
rs_c.MoveNext
rs_c.Close
Call Form_Load
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim i As Integer
Form2.Left = 5400
Form2.Top = 1500
Text4.Text = nam
For j = 0 To 1
i = 0
Call gy_load
rs_c.Open "select * from 录入表 ", cn_c, adOpenKeyset, adLockOptimistic
Combo1(0).Text = "请输入机型"
Combo1(j).Clear
While Not rs_c.EOF
Combo1(j).List(i) = rs_c.Fields(j)
i = i + 1
rs_c.MoveNext
Wend
Next j
For i = 0 To 1
For j = Combo1(i).ListCount - 1 To 0 Step -1
For k = j - 1 To 0 Step -1
If Combo1(i).List(j) = Combo1(i).List(k) Then
Combo1(i).RemoveItem j
End If
k = k - 1
Next k
Next j
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -