📄 frm_bookdamageitem.frm
字号:
VERSION 5.00
Begin VB.Form Frm_BookDamageItem
BorderStyle = 3 'Fixed Dialog
Caption = "图书损坏"
ClientHeight = 3000
ClientLeft = 45
ClientTop = 435
ClientWidth = 5880
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3000
ScaleWidth = 5880
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Caption = "基本信息"
Height = 1695
Left = 240
TabIndex = 11
Top = 600
Width = 5415
Begin LabMangeSystem.FTextBox Txt_BrwID
Height = 300
Left = 1440
TabIndex = 0
Top = 360
Width = 1695
_ExtentX = 2990
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "Tahoma"
FontSize = 8.25
AutoSelAll = -1 'True
End
Begin LabMangeSystem.FTextBox Txt_Info
Height = 300
Left = 1440
TabIndex = 2
Top = 720
Width = 3735
_ExtentX = 6588
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "Tahoma"
FontSize = 8.25
AutoSelAll = -1 'True
End
Begin LabMangeSystem.FTextBox Txt_Cash
Height = 300
Left = 4200
TabIndex = 1
Top = 360
Width = 975
_ExtentX = 1720
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "Tahoma"
FontSize = 8.25
AutoSelAll = -1 'True
isNumber = -1 'True
MaxLength = 8
End
Begin LabMangeSystem.FTextBox Txt_Other
Height = 300
Left = 1440
TabIndex = 3
Top = 1080
Width = 3735
_ExtentX = 6588
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "Tahoma"
FontSize = 8.25
AutoSelAll = -1 'True
End
Begin VB.Label Lbl_Other
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "备注"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 195
Left = 240
TabIndex = 15
Top = 1133
Width = 360
End
Begin VB.Label Lbl_Cash
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "赔偿金额"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 195
Left = 3360
TabIndex = 14
Top = 413
Width = 720
End
Begin VB.Label Lbl_Info
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "损坏描述"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 195
Left = 240
TabIndex = 13
Top = 773
Width = 720
End
Begin VB.Label Lbl_BrwID
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书借阅编号"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808080&
Height = 195
Left = 240
TabIndex = 12
Top = 413
Width = 1080
End
End
Begin VB.PictureBox Pic_TitleBar
Align = 1 'Align Top
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 0
ScaleHeight = 480
ScaleWidth = 5880
TabIndex = 6
Top = 0
Width = 5880
Begin VB.PictureBox Pic_TBarSub1
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 480
Left = 0
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 7
Top = 0
Width = 480
Begin VB.PictureBox Pic_TBarSymbol
Appearance = 0 'Flat
AutoRedraw = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 240
Left = 120
Picture = "Frm_BookDamageItem.frx":0000
ScaleHeight = 240
ScaleWidth = 240
TabIndex = 8
Top = 120
Width = 240
End
End
Begin LabMangeSystem.XButton Cmd_TBarClose
Height = 240
Left = 5520
TabIndex = 9
Top = 120
Width = 240
_ExtentX = 423
_ExtentY = 423
Caption = ""
ToolTip = "关闭当前窗口"
BackColor = 16777215
MouseDownColor = -2147483644
MouseOnColor = -2147483644
StyleColor = 0
Style3dColor1 = 16577259
Style3dColor2 = 8421504
Picture = "Frm_BookDamageItem.frx":058A
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Lbl_TBarText
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "TitleBar Text"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 195
Left = 600
TabIndex = 10
Top = 150
Width = 1095
End
End
Begin LabMangeSystem.XButton Cmd_OK
Height = 375
Left = 3360
TabIndex = 4
Top = 2400
Width = 1095
_ExtentX = 1931
_ExtentY = 661
Caption = ""
BackColor = 14737632
ForeColor = 8421504
MouseDownColor = -2147483644
MouseOnColor = -2147483644
StyleColor = 16777215
Style3dColor1 = 16577259
Style3dColor2 = 8421504
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
IfDraw = -1 'True
End
Begin LabMangeSystem.XButton Cmd_Close
Height = 375
Left = 4560
TabIndex = 5
Top = 2400
Width = 1095
_ExtentX = 1931
_ExtentY = 661
Caption = "关闭"
BackColor = 14737632
ForeColor = 8421504
MouseDownColor = -2147483644
MouseOnColor = -2147483644
StyleColor = 16777215
Style3dColor1 = 16577259
Style3dColor2 = 8421504
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
IfDraw = -1 'True
End
End
Attribute VB_Name = "Frm_BookDamageItem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public xDmgID As String '图书损坏编号
Public FormType As String '窗口类型(添加 OR 修改)
Option Explicit
Private Sub Cmd_Close_Click()
Unload Me
End Sub
Private Sub Cmd_OK_Click()
Dim Err_Msg As String
If Txt_BrwID.Text = vbNullString Or _
Txt_Cash.Text = vbNullString Or _
Txt_Info.Text = vbNullString Then
MsgFrm "请输入必要信息!", "!", "提示"
Exit Sub
End If
On Error GoTo ERRORZONE
If FormType = "ADD" Then
If FindRecord(Txt_BrwID.Text) = True Then MsgFrm "该图书借阅编号已经存在!", "x", "错误": Exit Sub
cnMain.Execute "INSERT 图书损坏 VALUES(" & _
Str2SQL(Format(Date, "yymmdd") & Format(Time, "hhnnss")) & "," & _
Str2SQL(Txt_BrwID.Text) & "," & _
Str2SQL(Txt_Info.Text) & "," & _
Val(Txt_Cash.Text) & "," & _
Str2SQL(Txt_Other.Text) & ")"
ElseIf FormType = "MOD" Then
cnMain.Execute "UPDATE 图书损坏 SET 损坏描述 = " & Str2SQL(Txt_Info.Text) & _
",赔偿金额 = " & Val(Txt_Cash.Text) & _
",备注 = " & Str2SQL(Txt_Other.Text) & _
" WHERE 图书损坏编号 = " & Str2SQL(xDmgID)
End If
Call Frm_BookDamage.Cmd_Refresh_Click
Unload Me
Exit Sub
ERRORZONE:
MsgFrm Err.Description, "x", "错误"
Call Frm_BookDamage.Cmd_Refresh_Click
End Sub
Private Sub Cmd_TBarClose_Click()
Call Cmd_Close_Click
End Sub
Private Sub Form_Load()
Call SetFormType
End Sub
Private Sub SetFormType()
If FormType = "ADD" Then
Me.caption = "添加图书损坏"
Cmd_OK.caption = "添加"
ElseIf FormType = "MOD" Then
Me.caption = "修改图书损坏"
Cmd_OK.caption = "修改"
Txt_BrwID.Enabled = False
Call LoadData
End If
Lbl_TBarText.caption = Me.caption
End Sub
Private Sub LoadData()
On Error Resume Next
Dim strSQL As String
Dim rs As New ADODB.Recordset
strSQL = "SELECT * FROM 图书损坏 WHERE 图书损坏编号 =" & Str2SQL(xDmgID)
rs.Open strSQL, cnMain, 1, 1
Txt_BrwID.Text = rs("图书借阅编号")
Txt_Cash.Text = rs("赔偿金额")
Txt_Info.Text = rs("损坏描述")
Txt_Other.Text = rs("备注")
End Sub
'添加之前查找是否存在相同编号的记录
Private Function FindRecord(strBrwID As String) As Boolean
Dim rs As New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM 图书损坏 WHERE 图书借阅编号 = " & Str2SQL(strBrwID)
rs.Open strSQL, cnMain, 1, 1
FindRecord = IIf(rs.EOF, False, True)
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -