📄 frmmodifyequipment.frm
字号:
VERSION 5.00
Begin VB.Form frmModifyEquipment
BorderStyle = 1 'Fixed Single
Caption = "编辑物业设备信息"
ClientHeight = 6060
ClientLeft = 45
ClientTop = 330
ClientWidth = 8010
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6060
ScaleWidth = 8010
Begin VB.Frame Frame1
Caption = "编辑物业设备信息"
Height = 2055
Left = 120
TabIndex = 10
Top = 240
Width = 7695
Begin VB.TextBox txtEquipmentName
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 1560
TabIndex = 13
Top = 480
Width = 2175
End
Begin VB.TextBox txtEquipmentValue
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 5160
TabIndex = 12
Top = 480
Width = 2295
End
Begin VB.TextBox txtComment
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1560
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 11
Top = 1110
Width = 5895
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "设备名称:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 16
Top = 510
Width = 1305
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "价值:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
TabIndex = 15
Top = 510
Width = 1095
End
Begin VB.Label Label9
Alignment = 2 'Center
Caption = "备注:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 14
Top = 1110
Width = 1095
End
End
Begin VB.Frame Frame3
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 = 5
Top = 4200
Width = 7695
Begin VB.CommandButton editCommand
Caption = "修改记录"
BeginProperty Font
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 = 1350
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 = 2160
TabIndex = 8
Top = 360
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 = 5880
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 = 3960
TabIndex = 6
Top = 360
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 = 2520
Width = 7695
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 = 2080
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 = 3920
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 = 5760
TabIndex = 1
Top = 360
Width = 1692
End
End
End
Attribute VB_Name = "frmModifyEquipment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tempEqipment As clsEquipment
Private Sub cancelCommand_Click()
Unload Me
End Sub
Private Sub deleteCommand_Click()
tempEqipment.DelRecord
End Sub
Private Sub editCommand_Click()
tempEqipment.EditRecord
Frame2.Enabled = False
firstCommand.Enabled = False
previousCommand.Enabled = False
nextCommand.Enabled = False
lastCommand.Enabled = False
txtEquipmentName.Enabled = True
txtEquipmentValue.Enabled = True
txtComment.Enabled = True
End Sub
Private Sub firstCommand_Click()
tempEqipment.mrc.MoveFirst
Call viewData
End Sub
Private Sub Form_Load()
Set tempEqipment = New clsEquipment
tempEqipment.LoadRecord
Frame2.Enabled = False
firstCommand.Enabled = False
previousCommand.Enabled = False
nextCommand.Enabled = False
lastCommand.Enabled = False
txtEquipmentName.Enabled = False
txtEquipmentValue.Enabled = False
txtComment.Enabled = False
End Sub
Public Sub viewData()
txtEquipmentName.Text = tempEqipment.mrc.Fields(1)
txtEquipmentValue.Text = tempEqipment.mrc.Fields(2)
txtComment.Text = tempEqipment.mrc.Fields(3)
End Sub
Private Sub lastCommand_Click()
tempEqipment.mrc.MoveLast
Call viewData
End Sub
Private Sub nextCommand_Click()
tempEqipment.mrc.MoveNext
If tempEqipment.mrc.EOF Then
tempEqipment.mrc.MoveFirst
End If
Call viewData
End Sub
Private Sub previousCommand_Click()
tempEqipment.mrc.MovePrevious
If tempEqipment.mrc.BOF Then
tempEqipment.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 tempEqipment.mcclean Then
MsgBox "请先修物业设备资料信息", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Not Testtxt(txtEquipmentName.Text) Then
MsgBox "请输入设备名称!", vbOKOnly + vbExclamation, "警告"
txtEquipmentName.SetFocus
Exit Sub
End If
If Not IsNumeric(txtEquipmentValue.Text) Then
MsgBox "请输入设备价值!", vbOKOnly + vbExclamation, "警告"
txtEquipmentValue.SetFocus
Exit Sub
End If
tempEqipment.Update Me.txtEquipmentName.Text, Me.txtEquipmentValue.Text, Me.txtComment.Text
Call viewData
Frame2.Enabled = True
firstCommand.Enabled = True
previousCommand.Enabled = True
nextCommand.Enabled = True
lastCommand.Enabled = True
txtEquipmentName.Enabled = False
txtEquipmentValue.Enabled = False
tempEqipment.mcclean = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -