?? 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 + -