📄 frmrst.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmRst
BorderStyle = 1 'Fixed Single
Caption = "读者时段统计"
ClientHeight = 3765
ClientLeft = 45
ClientTop = 435
ClientWidth = 5895
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 3765
ScaleWidth = 5895
Visible = 0 'False
Begin VB.Frame Frame3
Caption = "统计结果"
Height = 1095
Left = 120
TabIndex = 5
Top = 2520
Visible = 0 'False
Width = 5655
Begin VB.TextBox Text3
Appearance = 0 'Flat
BackColor = &H8000000F&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 3240
Locked = -1 'True
TabIndex = 14
Top = 360
Width = 975
End
Begin VB.TextBox Text2
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000F&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 960
Locked = -1 'True
TabIndex = 11
Top = 360
Width = 975
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 5040
TabIndex = 16
Top = 720
Width = 420
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "册"
Height = 180
Left = 4320
TabIndex = 15
Top = 480
Width = 180
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "还书量:"
Height = 180
Left = 2520
TabIndex = 13
Top = 480
Width = 720
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "册"
Height = 180
Left = 2040
TabIndex = 12
Top = 480
Width = 180
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "借书量:"
Height = 180
Left = 240
TabIndex = 10
Top = 480
Width = 720
End
End
Begin VB.Frame Frame2
Caption = "选择时段"
Height = 1095
Left = 120
TabIndex = 4
Top = 1320
Visible = 0 'False
Width = 5655
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 3960
TabIndex = 9
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
Format = 20119553
CurrentDate = 38177
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1200
TabIndex = 6
Top = 360
Width = 1575
_ExtentX = 2778
_ExtentY = 661
_Version = 393216
Format = 20119553
CurrentDate = 38177
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "统计"
Height = 180
Left = 5040
TabIndex = 17
Top = 840
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "结束时间:"
Height = 180
Left = 3000
TabIndex = 8
Top = 480
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "开始时间:"
Height = 180
Left = 240
TabIndex = 7
Top = 480
Width = 900
End
End
Begin VB.Frame Frame1
Caption = "统计读者"
Height = 1095
Left = 120
TabIndex = 0
Top = 120
Width = 5655
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00C0FFFF&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 2
Top = 360
Width = 2295
End
Begin VB.Label Label2
Caption = "<确定按回车键>"
ForeColor = &H000000FF&
Height = 375
Left = 3840
TabIndex = 3
Top = 480
Width = 1575
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "读者编号:"
Height = 180
Left = 240
TabIndex = 1
Top = 480
Width = 900
End
End
End
Attribute VB_Name = "FrmRst"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
dbl '连接数据库
Height = 1800 'form的高
FrmRst.Show
Frame1.Top = 100 '设置frame1到顶的距离
Frame2.Top = 100
Frame3.Top = 100
DTPicker1.Value = Now
DTPicker2.Value = Now
End Sub
Private Sub form_mousemove(button As Integer, shift As Integer, x As Single, y As Single) '鼠标移动效果
Label9.ForeColor = &H0&
Label10.ForeColor = &H0&
End Sub
Private Sub text1_keypress(keyascii As Integer) '回车键事件
Dim StrSQL As String
If keyascii = "13" And Text1.Text <> "" Then
StrSQL = "select * from readerinfo where 读者编号= '" & Text1.Text & "'"
Set g_rs = g_db.OpenRecordset(StrSQL)
If Not g_rs.EOF Then
Frame2.Visible = True '显示frame2
Frame1.Visible = False
Else
MsgBox "对不起,你所输入的读者编号并不存在,请核对!", vbExclamation + vbOKOnly, "提示"
Set g_rs = Nothing '释放
Exit Sub
End If
End If
End Sub
Private Sub label9_mousemove(button As Integer, shift As Integer, x As Single, y As Single) '鼠标移动效果
Label9.ForeColor = &HFF&
End Sub
Private Sub label10_mousemove(button As Integer, shift As Integer, x As Single, y As Single)
Label10.ForeColor = &HFF&
End Sub
Private Sub label10_click()
Dim StrSQL As String
Frame3.Visible = True '显示frame3
Frame2.Visible = False
StrSQL = "select * from lentinfo where 读者编号= '" & Text1.Text & "' and 借书日期>= #" & DTPicker1.Value & "# and 借书日期 <= #" & DTPicker2.Value & "#"
Set g_rs = g_db.OpenRecordset(StrSQL)
If Not g_rs.EOF Then
g_rs.MoveLast '指针移动到最后一项,以获得借书量
Text2.Text = g_rs.RecordCount
Else
Text2.Text = "0"
End If
Set g_rs = Nothing
StrSQL = "select * from lentinfo where 读者编号= '" & Text1.Text & "' and 还书日期>= #" & DTPicker1.Value & "# and 还书日期 <= #" & DTPicker2.Value & "#"
Set g_rs = g_db.OpenRecordset(StrSQL)
If Not g_rs.EOF Then
g_rs.MoveLast '指针移动到最后一项,以获得还书量
Text3.Text = g_rs.RecordCount
Else
Text3.Text = "0"
End If
Set g_rs = Nothing
End Sub
Private Sub label9_click()
Frame1.Visible = True '显示frame1
Frame3.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -