📄 frmmodifyrepair.frm
字号:
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 270
TabIndex = 9
Top = 390
Width = 1470
End
Begin VB.CommandButton updateCommand
Caption = "保存记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 2040
TabIndex = 8
Top = 390
Width = 1455
End
Begin VB.CommandButton cancelCommand
Caption = "关闭退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 5640
TabIndex = 7
Top = 360
Width = 1575
End
Begin VB.CommandButton deleteCommand
Caption = "删除记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3825
TabIndex = 6
Top = 390
Width = 1440
End
End
Begin VB.Frame Frame2
Caption = "查看报修信息"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1092
Left = 120
TabIndex = 0
Top = 3480
Width = 7455
Begin VB.CommandButton firstCommand
Caption = "第一条记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 240
TabIndex = 4
Top = 360
Width = 1452
End
Begin VB.CommandButton previousCommand
Caption = "上一条记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 2000
TabIndex = 3
Top = 360
Width = 1452
End
Begin VB.CommandButton nextCommand
Caption = "下一条记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 3760
TabIndex = 2
Top = 360
Width = 1452
End
Begin VB.CommandButton lastCommand
Caption = "最后一条记录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 492
Left = 5520
TabIndex = 1
Top = 360
Width = 1692
End
End
End
Attribute VB_Name = "frmModifyRepair"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tempRepair As clsRepair
Private Sub cancelCommand_Click()
Unload Me
End Sub
Private Sub deleteCommand_Click()
tempRepair.DelRecord
End Sub
Private Sub editCommand_Click()
tempRepair.EditRecord
Frame2.Enabled = False
firstCommand.Enabled = False
previousCommand.Enabled = False
nextCommand.Enabled = False
lastCommand.Enabled = False
txtRepairContent.Enabled = True
txtRepairCharge.Enabled = True
txtRepairDate.Enabled = True
txtComment.Enabled = True
End Sub
Private Sub firstCommand_Click()
mrc.MoveFirst
Call viewData
End Sub
Private Sub Form_Load()
Set tempRepair = New clsRepair
tempRepair.LoadRecord
Call viewData
txtRepairContent.Enabled = False
txtRepairCharge.Enabled = False
txtRepairDate.Enabled = False
txtComment.Enabled = False
End Sub
Public Sub viewData()
txtRepairContent.Text = tempRepair.mrc.Fields(1)
txtRepairCharge.Text = tempRepair.mrc.Fields(2)
txtRepairDate.Text = tempRepair.mrc.Fields(3)
txtUserName.Text = tempRepair.mrc.Fields(4)
txtComment.Text = tempRepair.mrc.Fields(5)
txtModifyName.Text = tempRepair.mrc.Fields(6)
txtModifyDate.Text = tempRepair.mrc.Fields(7)
End Sub
Private Sub lastCommand_Click()
tempRepair.mrc.MoveLast
Call viewData
End Sub
Private Sub nextCommand_Click()
tempRepair.mrc.MoveNext
If tempRepair.mrc.EOF Then
tempRepair.mrc.MoveFirst
End If
Call viewData
End Sub
Private Sub previousCommand_Click()
tempRepair.mrc.MovePrevious
If tempRepair.mrc.BOF Then
tempRepair.mrc.MoveLast
End If
Call viewData
End Sub
Private Sub updateCommand_Click()
Dim txtSQL As String
Dim MsgText As String
Dim mrcc As ADODB.Recordset
If tempRepair.mcclean Then
MsgBox "请先报修资料信息", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Not Testtxt(txtRepairContent.Text) Then
MsgBox "请输入维修内容!", vbOKOnly + vbExclamation, "警告"
txtRepairContent.SetFocus
Exit Sub
End If
If Not IsNumeric(txtRepairCharge.Text) Then
MsgBox "请输入维修费用!", vbOKOnly + vbExclamation, "警告"
txtRepairCharge.SetFocus
Exit Sub
End If
If Not IsDate(txtRepairDate.Text) Then
MsgBox "请输入维修日期!", vbOKOnly + vbExclamation, "警告"
txtRepairDate.SetFocus
Exit Sub
End If
If Not Testtxt(txtUserName.Text) Then
MsgBox "请输入住户名称!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Exit Sub
End If
tempRepair.Update Me.txtRepairContent.Text, Me.txtRepairCharge.Text, Me.txtRepairDate.Text, Me.txtUserName.Text, Me.txtComment.Text
Call viewData
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtRepairContent.Enabled = False
txtRepairCharge.Enabled = False
txtRepairDate.Enabled = False
tempRepair.mcclean = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -