📄 frmreaderlostbook_choose.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmreaderlostbook_choose
Caption = "读者借阅信息列表"
ClientHeight = 6045
ClientLeft = 60
ClientTop = 450
ClientWidth = 8565
Icon = "frmreaderlostbook_choose.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 6045
ScaleWidth = 8565
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdchoose
Caption = "选 择"
Default = -1 'True
Height = 495
Left = 7200
TabIndex = 3
Top = 4680
Width = 1215
End
Begin VB.CommandButton cmdexit
Cancel = -1 'True
Caption = "返 回"
Height = 495
Left = 7200
TabIndex = 4
Top = 5400
Width = 1215
End
Begin VB.TextBox txt读者编号
Height = 375
Left = 4560
TabIndex = 1
Top = 464
Width = 2175
End
Begin VB.TextBox txt图书编号
Height = 390
Left = 1200
TabIndex = 0
Top = 456
Width = 2175
End
Begin VB.PictureBox Picbg1
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 1440
Left = 7080
Picture = "frmreaderlostbook_choose.frx":19862
ScaleHeight = 1440
ScaleWidth = 1440
TabIndex = 7
Top = 720
Width = 1440
End
Begin MSFlexGridLib.MSFlexGrid borrowedbookGrid
Height = 4815
Left = 120
TabIndex = 2
Top = 1080
Width = 6855
_ExtentX = 12091
_ExtentY = 8493
_Version = 393216
Rows = 1
Cols = 10
FixedCols = 0
BackColor = -2147483639
BackColorBkg = 14737632
GridColor = 14737632
GridColorFixed = 14737632
SelectionMode = 1
AllowUserResizing= 1
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "读者编号:"
Height = 180
Left = 3600
TabIndex = 6
Top = 561
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "图书编号:"
Height = 180
Left = 240
TabIndex = 5
Top = 561
Width = 900
End
End
Attribute VB_Name = "frmreaderlostbook_choose"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function borrowBookChoose(sql As String)
Dim rs, rs2 As New ADODB.Recordset
Dim sql2 As String
Set rs = TransactSQL(sql)
With borrowedbookGrid
.Rows = 1
If Not rs.EOF Then
While Not rs.EOF
sql2 = "select 图书价格 from tsxxb where 图书编号 = '" & rs(0) & "'"
Set rs2 = TransactSQL(sql2)
.Rows = .Rows + 1
.TextMatrix(.Rows - 1, 0) = rs(0)
.TextMatrix(.Rows - 1, 1) = rs(1)
.TextMatrix(.Rows - 1, 2) = rs(2)
.TextMatrix(.Rows - 1, 3) = rs(3)
.TextMatrix(.Rows - 1, 4) = rs(4)
.TextMatrix(.Rows - 1, 5) = rs2(0)
.TextMatrix(.Rows - 1, 6) = rs(5)
.TextMatrix(.Rows - 1, 7) = rs(6)
.TextMatrix(.Rows - 1, 8) = rs(7)
.TextMatrix(.Rows - 1, 9) = rs(8)
rs.MoveNext
Wend
rs2.Close
End If
End With
rs.Close
End Function
Private Sub cmdchoose_Click()
With borrowedbookGrid
frmlostbook.txt图书编号(1).Text = .TextMatrix(.Row, 0)
frmlostbook.txt图书名称.Text = .TextMatrix(.Row, 1)
frmlostbook.txt读者编号(1).Text = .TextMatrix(.Row, 2)
frmlostbook.txt读者姓名.Text = .TextMatrix(.Row, 3)
frmlostbook.txt借阅数量.Text = .TextMatrix(.Row, 4)
frmlostbook.txt借阅日期.Text = .TextMatrix(.Row, 6)
frmlostbook.txt图书价格.Text = Format(.TextMatrix(.Row, 5), "0.00")
If .TextMatrix(.Row, 0) = "" Then
frmlostbook.DTP罚款日期(2).Value = Trim(Year(Now)) & "-" & Trim(Month(Now)) & "-" & Trim(day(Now))
End If
frmlostbook.cmdexec.Enabled = True
End With
Unload Me
End Sub
Private Sub cmdexit_Click()
Call frmlostbook.clear
Unload Me
End Sub
Private Sub Form_Load()
Call fullpic(Me, Picbg1) '背景图
Me.Left = (frmmain.ScaleWidth - Me.Width) / 2
Me.Top = (frmmain.ScaleHeight - Me.Height) / 2
With borrowedbookGrid
.TextMatrix(0, 0) = "图书编号"
.TextMatrix(0, 1) = "图书名称"
.TextMatrix(0, 2) = "读者编号"
.TextMatrix(0, 3) = "读者姓名"
.TextMatrix(0, 4) = "借阅数量"
.TextMatrix(0, 5) = "图书价格"
.TextMatrix(0, 6) = "借阅日期"
.TextMatrix(0, 7) = "应还日期"
.TextMatrix(0, 8) = "续借次数"
.TextMatrix(0, 9) = "操作员"
.ColWidth(0) = 1200
.ColWidth(1) = 1800
.ColWidth(2) = 1200
.ColWidth(3) = 1000
.ColWidth(4) = 800
.ColWidth(5) = 800
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 800
.ColWidth(9) = 1000
End With
Dim sql As String
'显示所有的读者借书信息
sql = "select * from jsxxb "
Call borrowBookChoose(sql)
End Sub
Private Sub txt图书编号_Change()
Dim sql As String
If txt图书编号.Text = "" Then
borrowedbookGrid.Rows = 1
End If
'按图书编号显示借阅信息
If Trim(txt读者编号.Text) = "" And Trim(txt图书编号.Text) = "" Then
sql = "select * from jsxxb "
Else
sql = "select * from jsxxb where 图书编号 like '" & Trim(txt图书编号.Text) & "%'"
End If
Call borrowBookChoose(sql)
End Sub
Private Sub txt读者编号_Change()
Dim sql As String
If txt读者编号.Text = "" Then
borrowedbookGrid.Rows = 1
End If
'按读者编号显示借阅信息
If Trim(txt读者编号.Text) = "" And Trim(txt图书编号.Text) = "" Then
sql = "select * from jsxxb "
Else
sql = "select * from jsxxb where 读者编号 like '" & Trim(txt读者编号.Text) & "%'"
End If
Call borrowBookChoose(sql)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -