📄 frmbookcancel.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmbookcancel
BorderStyle = 1 'Fixed Single
Caption = "注销图书"
ClientHeight = 5310
ClientLeft = 45
ClientTop = 435
ClientWidth = 5625
Icon = "frmbookcancel.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 5310
ScaleWidth = 5625
Begin MSComCtl2.DTPicker DTP注销日期
Height = 375
Left = 1680
TabIndex = 2
Top = 3600
Width = 3135
_ExtentX = 5530
_ExtentY = 661
_Version = 393216
Format = 25296897
CurrentDate = 38844
End
Begin VB.CommandButton cmd图书选择
Caption = ".."
Height = 375
Left = 4440
TabIndex = 0
Top = 720
Width = 375
End
Begin VB.TextBox txt注销数量
Height = 375
Left = 1680
TabIndex = 1
Top = 2880
Width = 3135
End
Begin VB.TextBox txt现存量
BackColor = &H8000000F&
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 11
Top = 2160
Width = 3135
End
Begin VB.TextBox txt图书名称
BackColor = &H8000000F&
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 10
Top = 1440
Width = 3135
End
Begin VB.CommandButton cmdexit
Cancel = -1 'True
Caption = "退出"
Height = 375
Left = 3360
TabIndex = 4
Top = 4560
Width = 1215
End
Begin VB.CommandButton cmdcancle
Caption = "注销"
Default = -1 'True
Height = 375
Left = 1080
TabIndex = 3
Top = 4560
Width = 1215
End
Begin VB.TextBox txt图书编号
BackColor = &H8000000F&
Enabled = 0 'False
Height = 375
Left = 1680
TabIndex = 5
Top = 720
Width = 3135
End
Begin VB.PictureBox Picbg1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 1440
Left = -840
Picture = "frmbookcancel.frx":19862
ScaleHeight = 1440
ScaleWidth = 1440
TabIndex = 12
Top = 4800
Width = 1440
End
Begin VB.Shape Shape1
BorderColor = &H8000000B&
Height = 615
Left = 600
Top = 4440
Width = 4455
End
Begin VB.Label label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书编号:"
Height = 180
Left = 600
TabIndex = 13
Top = 840
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "注销日期:"
Height = 180
Left = 600
TabIndex = 9
Top = 3720
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "注销数量:"
Height = 180
Left = 600
TabIndex = 8
Top = 3000
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = " 现 存 量:"
Height = 180
Left = 480
TabIndex = 7
Top = 2280
Width = 990
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书名称:"
Height = 180
Left = 600
TabIndex = 6
Top = 1560
Width = 900
End
End
Attribute VB_Name = "frmbookcancel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-------------------------------------------------------
' 作者:龙茂春
' 功能: 当该书不能再用或损失可进行注销工作。
'-------------------------------------------------------
Private Sub cmdcancle_Click()
Dim rs As New ADODB.Recordset
Dim sql As String
If txt图书编号.Text = "" And txt注销数量.Text = "" Then
MsgBox "请先选定图书信息!"
ElseIf Val(txt注销数量.Text) < 0 Then
MsgBox "注销数量不能小于零!", vbOKOnly
ElseIf txt注销数量.Text > txt现存量.Text Then
MsgBox "注销数量不能大于库存量,请核实数据!", vbOKOnly
Else
Dim sql2 As String
sql2 = "select * from zxxxb "
Set rs = TransactSQL(sql2)
rs.AddNew '添加新纪录
rs.Fields(0) = Trim(txt图书编号.Text)
rs.Fields(1) = Val(txt注销数量.Text)
rs.Fields(2) = DTP注销日期.Value
rs.Fields(3) = user
rs.Update
'更新图书信息表中的记录
sql = "select * from tsxxb where 图书编号='" & txt图书编号.Text & "'"
Set rs = TransactSQL(sql)
rs(12) = rs(12) - Val(txt注销数量.Text)
rs(13) = rs(13) - Val(txt注销数量.Text)
If rs(13) > 0 Then
rs(15) = "否"
Else
rs(15) = "是"
End If
rs.Update
MsgBox "注销成功!", vbOKOnly
txt图书编号.Text = ""
txt图书名称.Text = ""
txt现存量.Text = 0
txt注销数量.Text = 0
DTP注销日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
rs.Close
End If
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmd图书选择_Click()
frmbookcancel_choose.Show 1
End Sub
Private Sub Form_Load()
Call fullpic(Me, Picbg1) '背景图
Me.Left = (frmmain.ScaleWidth - Me.Width) / 2
Me.Top = (frmmain.ScaleHeight - Me.Height) / 2
DTP注销日期.Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -