📄 returninfo.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form returnInfo
BackColor = &H00C0FFC0&
Caption = "归还信息管理"
ClientHeight = 5385
ClientLeft = 60
ClientTop = 345
ClientWidth = 9780
LinkTopic = "Form1"
LockControls = -1 'True
Picture = "returnInfo.frx":0000
ScaleHeight = 5385
ScaleWidth = 9780
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox curSelBkNo
Height = 375
Left = 1920
TabIndex = 2
Top = 4800
Width = 1815
End
Begin VB.CommandButton delBrwInfo
Caption = "确定归还"
Height = 375
Left = 5040
TabIndex = 1
Top = 4800
Width = 1335
End
Begin VB.CommandButton EXIT
Caption = "返 回"
Height = 375
Left = 7560
TabIndex = 0
Top = 4800
Width = 1335
End
Begin MSFlexGridLib.MSFlexGrid borrowedListGrid
Height = 3855
Left = 0
TabIndex = 3
Top = 720
Width = 9855
_ExtentX = 17383
_ExtentY = 6800
_Version = 393216
Rows = 15
Cols = 12
FixedCols = 0
BackColorBkg = 14737632
SelectionMode = 1
AllowUserResizing= 1
End
Begin VB.Label Label1
BackColor = &H00C0FFC0&
BackStyle = 0 'Transparent
Caption = "待归还列表"
BeginProperty Font
Name = "楷体_GB2312"
Size = 24
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 3480
TabIndex = 5
Top = 120
Width = 2535
End
Begin VB.Label Label3
BackColor = &H00C0FFC0&
BackStyle = 0 'Transparent
Caption = "归还产品编号:"
Height = 255
Left = 480
TabIndex = 4
Top = 4920
Width = 1575
End
End
Attribute VB_Name = "returnInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function borrowList_update()
Dim rs As New ADODB.Recordset
Dim sql As String
sql = "select * from borrowInfo"
Dim i As Integer
Set rs = TransactSQL(sql)
With borrowedListGrid
.Rows = 1
While Not rs.EOF
.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) = rs(5)
rs.MoveNext
Wend
End With
End Function
Private Sub borrowedListGrid_Click()
Dim i As Integer
'首先获得选定的行号
i = borrowedListGrid.Row
'将选定行的内容在文本框中显示
curSelBkNo.Text = borrowedListGrid.TextMatrix(i, 3)
End Sub
Private Sub delBrwInfo_Click()
Dim resMsg As String
Dim rs As New ADODB.Recordset
Dim sql As String
Dim sql2 As String
sql = "select bookno from borrowInfo where bookno = '" & curSelBkNo.Text & "'"
sql2 = "delete from borrowInfo where bookno = '" & curSelBkNo.Text & "'"
If Trim(curSelBkNo.Text) = "" Then
MsgBox "请选择或输入要归还的产品编号!", vbOKOnly
Else
Set rs = TransactSQL(sql)
If rs.EOF = True Then
MsgBox "没有该编号产品的借出信息!", vbOKOnly
rs.Close
Else
resMsg = MsgBox("真的要归还该编号产品吗?", vbOKCancel, "警告")
If resMsg = vbOK Then
TransactSQL (sql2)
MsgBox "该编号产品已经归还!", vbOKOnly
Call borrowList_update
End If
End If
End If
End Sub
Private Sub Form_Activate()
Call borrowList_update
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
'MSFlexGrid1 表头
With borrowedListGrid
.TextMatrix(0, 0) = "会员编号"
.TextMatrix(0, 1) = "会员姓名"
.TextMatrix(0, 2) = "产品编号"
.TextMatrix(0, 3) = "产品名称"
.TextMatrix(0, 4) = "产品类型"
.TextMatrix(0, 5) = "借出日期"
.ColWidth(4) = 1500
.ColWidth(5) = 1500
.ColWidth(8) = 1500
.ColWidth(9) = 1200
.ColWidth(10) = 1200
.ColWidth(11) = 2000
.BackColorFixed = RGB(247, 214, 157)
End With
'在 中查询相应信息,在MSFlexGrid1中显示
Call borrowList_update
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -