📄 frmwxjlxg.frm
字号:
VERSION 5.00
Begin VB.Form FrmWxJLXg
BorderStyle = 1 'Fixed Single
Caption = "维修记录_修改"
ClientHeight = 4605
ClientLeft = 45
ClientTop = 435
ClientWidth = 3480
ControlBox = 0 'False
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4605
ScaleWidth = 3480
Begin VB.TextBox TxtName
ForeColor = &H80000006&
Height = 270
Left = 1200
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 1680
Width = 975
End
Begin VB.TextBox Text3
ForeColor = &H80000006&
Height = 270
Left = 1200
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 1224
Width = 2055
End
Begin VB.TextBox Text2
ForeColor = &H80000006&
Height = 270
Left = 1200
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 788
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 1920
TabIndex = 10
Top = 3960
Width = 975
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 375
Left = 480
TabIndex = 8
Top = 3960
Width = 855
End
Begin VB.ComboBox Cmb1
Height = 300
Left = 2280
TabIndex = 9
Top = 1660
Width = 1095
End
Begin VB.TextBox Text1
ForeColor = &H80000006&
Height = 270
Left = 1200
TabIndex = 0
Top = 352
Width = 2055
End
Begin VB.TextBox Text4
ForeColor = &H80000006&
Height = 270
Left = 1200
TabIndex = 4
Top = 2126
Width = 2055
End
Begin VB.TextBox Text5
ForeColor = &H80000006&
Height = 270
Left = 1200
TabIndex = 5
Top = 2562
Width = 2055
End
Begin VB.TextBox Text6
ForeColor = &H80000006&
Height = 270
Left = 1200
TabIndex = 6
Top = 2998
Width = 2055
End
Begin VB.TextBox Text7
ForeColor = &H80000006&
Height = 270
Left = 1200
TabIndex = 7
Top = 3435
Width = 2055
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备 注"
ForeColor = &H00FF0000&
Height = 180
Left = 240
TabIndex = 19
Top = 3480
Width = 450
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "维修记录修改"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 255
Left = 960
TabIndex = 18
Top = 0
Width = 1695
End
Begin VB.Label Label8
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "更换件:"
ForeColor = &H00FF0000&
Height = 180
Left = 240
TabIndex = 17
Top = 2171
Width = 720
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "维修时间:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 16
Top = 1232
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "维修人员:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 15
Top = 1688
Width = 1095
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "故障名称:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 14
Top = 360
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "反映时间:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 13
Top = 840
Width = 1095
End
Begin VB.Label Label7
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "厂 家:"
ForeColor = &H00FF0000&
Height = 180
Left = 240
TabIndex = 12
Top = 2640
Width = 630
End
Begin VB.Label Label9
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "零件编号:"
ForeColor = &H00FF0000&
Height = 180
Left = 120
TabIndex = 11
Top = 3075
Width = 900
End
End
Attribute VB_Name = "FrmWxJLXg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Cmb1_Click()
TxtName.Text = Cmb1.Text
End Sub
Private Sub Command1_Click()
If TxtName.Text = "" Then
MsgBox "请选择维修人员!"
Exit Sub
End If
If Text1.Text = "" Then
MsgBox "请填写故障名称!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请填写反映时间!"
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "请填写维修时间!"
Exit Sub
End If
If Text4.Text = "" Then
MsgBox "请填写更换件!"
Exit Sub
End If
If Text5.Text = "" Then
MsgBox "请填写厂家!"
Exit Sub
End If
If Text6.Text = "" Then
MsgBox "请填写零件编号!"
Exit Sub
End If
Dim a As Integer
a = MsgBox("********你确定此操作吗?**********" & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
sSql = "SELECT * FROM 维修记录 where ID=" & RemId
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
'Rs!保养单号 = Bill
Rs.Fields("故障名称") = Text1.Text
Rs.Fields("反映时间") = Text2.Text
Rs.Fields("维修时间") = Text3.Text
Rs.Fields("维修人员") = TxtName.Text
Rs.Fields("更换件") = Text4.Text
Rs.Fields("厂家") = Text5.Text
Rs.Fields("零件编号") = Text6.Text
If Text7.Text = "" Then Rs!备注 = "-" Else Rs!备注 = Text7.Text
Rs.Update
Rs.Close
MsgBox "修改成功!"
FrmWXJL.Show
Unload Me
End If
If a = 2 Then Exit Sub
End Sub
Private Sub Command2_Click()
FrmBYJL.Show
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Set Rs = New Recordset
Set_Ygb
Set_Int
End Sub
Private Sub Set_Ygb() '员工表
Dim i As Integer
'On Error GoTo DataErr
sSql = "SELECT 姓名 FROM 员工表"
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Cmb1.Clear
Do While Not Rs.EOF
Cmb1.AddItem Rs.Fields(0)
Rs.MoveNext
Loop
Rs.Close
Exit Sub
'DataErr:
' MsgBox Err.Description
End Sub
Private Sub Set_Int()
'On Error GoTo DataErr
sSql = "SELECT 故障名称,反映时间,维修时间,维修人员,更换件,厂家,零件编号,备注 FROM 维修记录 where ID =" & RemId
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Text1.Text = Rs.Fields("故障名称")
Text2.Text = Rs.Fields("反映时间")
Text3.Text = Rs.Fields("维修时间")
TxtName.Text = Rs.Fields("维修人员")
Text4.Text = Rs.Fields("更换件")
Text5.Text = Rs.Fields("厂家")
Text6.Text = Rs.Fields("零件编号")
If Rs.Fields("备注") = "-" Then
Text7.Text = ""
Else
Text7.Text = Rs.Fields("备注")
End If
Rs.Close
Exit Sub
'DataErr:
' MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -