📄 frmlossfind.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmLossFind
BorderStyle = 3 'Fixed Dialog
Caption = "挂失信息查询"
ClientHeight = 6540
ClientLeft = 45
ClientTop = 330
ClientWidth = 5445
Icon = "frmLossFind.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6540
ScaleWidth = 5445
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame fraFind
Caption = "查询挂失卡信息"
Height = 2175
Left = 240
TabIndex = 0
Top = 120
Width = 4935
Begin VB.TextBox txtCH_ID
Height = 270
Left = 1440
MaxLength = 10
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.ComboBox cboUser
Height = 300
Left = 1440
Style = 2 'Dropdown List
TabIndex = 4
Top = 780
Width = 1335
End
Begin VB.ComboBox cboFindType
Height = 300
ItemData = "frmLossFind.frx":000C
Left = 1440
List = "frmLossFind.frx":0016
Style = 2 'Dropdown List
TabIndex = 3
Top = 1200
Width = 1335
End
Begin VB.CommandButton cmdfFind
Caption = "查 询"
Default = -1 'True
Height = 375
Left = 3360
TabIndex = 2
Top = 480
Width = 1095
End
Begin VB.CommandButton cmdPrint
Caption = "打印预览"
Height = 375
Left = 3360
TabIndex = 1
Top = 1080
Width = 1095
End
Begin MSComCtl2.DTPicker DTPTo
Height = 300
Left = 3240
TabIndex = 6
Top = 1680
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 24772609
CurrentDate = 38057
End
Begin MSComCtl2.DTPicker DTPFrom
Height = 300
Left = 1440
TabIndex = 7
Top = 1680
Width = 1335
_ExtentX = 2355
_ExtentY = 529
_Version = 393216
Format = 24772609
CurrentDate = 38057
End
Begin VB.Label lblCH_ID
AutoSize = -1 'True
Caption = "持卡人ID:"
Height = 180
Left = 360
TabIndex = 12
Top = 360
Width = 900
End
Begin VB.Label lbluser
AutoSize = -1 'True
Caption = "用户:"
Height = 180
Left = 360
TabIndex = 11
Top = 840
Width = 540
End
Begin VB.Label lblType
AutoSize = -1 'True
Caption = "查询方式:"
Height = 180
Left = 360
TabIndex = 10
Top = 1260
Width = 900
End
Begin VB.Label lblFrom
AutoSize = -1 'True
Caption = "从:"
Height = 180
Left = 360
TabIndex = 9
Top = 1680
Width = 360
End
Begin VB.Label lblTo
AutoSize = -1 'True
Caption = "到:"
Height = 180
Left = 2880
TabIndex = 8
Top = 1740
Width = 360
End
End
Begin MSComctlLib.ListView lvwLoss
Height = 3495
Left = 240
TabIndex = 13
Top = 2640
Width = 4935
_ExtentX = 8705
_ExtentY = 6165
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "目前的挂失信息:"
Height = 180
Left = 240
TabIndex = 17
Top = 2400
Width = 1440
End
Begin VB.Label lblZhang
AutoSize = -1 'True
Caption = "张"
Height = 180
Left = 1320
TabIndex = 16
Top = 6240
Width = 180
End
Begin VB.Label lblnumber
AutoSize = -1 'True
Height = 180
Left = 1080
TabIndex = 15
Top = 6240
Width = 90
End
Begin VB.Label lblInfo
AutoSize = -1 'True
Caption = "共挂失卡"
Height = 180
Left = 240
TabIndex = 14
Top = 6240
Width = 720
End
End
Attribute VB_Name = "frmLossFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' ''
''Filename frmLoss.frm ''
'' ''
''Created On 2004.3.17 ''
'' ''
''Description 查询挂失卡信息并提供打印功能 ''
'' ''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim rsUser As Recordset
Public rsloss As Recordset
Dim lItem As ListItem
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''根据用户的日期选择,显示或隐藏相关信息 ''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub cboFindType_Click()
If cboFindType.Text = "单日查询" Then
lblFrom.Caption = "查询日期:"
lblTo.Visible = False
DTPTo.Visible = False
ElseIf cboFindType.Text = "时间段查询" Then
lblFrom.Caption = "从:"
lblTo.Visible = True
DTPTo.Visible = True
End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''根据查询条件查询信息,并将其结果显示在下方的列表中 ''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub cmdfFind_Click()
lblTitle.Caption = "查询结果:"
Set rsloss = New Recordset
Dim strfind As String
strfind = "select * from TbLoss,tbuser" & where & " and TbLoss.u_id=tbuser.u_id "
rsloss.Open strfind, Modmain.conn, 3, 2
lblnumber.Caption = rsloss.RecordCount
LoadDate
End Sub
Private Function where() As String '查询条件
Dim s As String
If txtCH_ID.Text <> "" Then
s = " where C_ID like '%" & Trim(txtCH_ID.Text) & "%'"
End If
If DTPTo.Visible = False Then
If s <> "" Then
s = s & "and loss_Date like '" & DTPFrom.Value & "'"
Else
s = " where loss_Date like '" & DTPFrom.Value & "'"
End If
Else
Dim dtFrom As String
Dim dtTo As String
'''''''''''''''''手工转换日期格式使其与ACCESS数据库相对应''''''''''''''''''''''''
dtFrom = Month(DTPFrom.Value) & "/" & Day(DTPFrom.Value) & "/" & Year(DTPFrom.Value)
dtTo = Month(DTPTo.Value) & "/" & Day(DTPTo.Value) & "/" & Year(DTPTo.Value)
If s <> "" Then
s = s & "and Loss_Date>= #" & dtFrom & "# and Loss_Date<=#" & dtTo & "#"
Else
s = " where Loss_Date>=#" & dtFrom & "# and Loss_Date<=#" & dtTo & "#"
End If
End If
If cboUser.Text <> "" Then
Set rsUser = New Recordset
rsUser.Open "select * from TbUser Where U_Name like '" & cboUser.Text & "'", Modmain.conn, 3, 2
If s <> "" Then
s = s & " and tbuser.U_ID like '" & rsUser.Fields!U_ID & "'"
Else
s = " where tbuser.U_ID like '" & rsUser.Fields!U_ID & "'"
End If
End If
where = s
End Function
Private Sub cmdPrint_Click()
If rsloss.RecordCount = 0 Then
MsgBox "没有可打印的信息!", vbOKOnly + vbExclamation, "机房管理"
Else
DRLoss.Show 1
End If
End Sub
Private Sub DTPFrom_Change()
If DTPFrom.Value <> "" Then
DTPTo.MinDate = DTPFrom.Value
End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''给用户列表框赋值 ''
''配置lvwExitCard控件 ''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub Form_Load()
Set rsUser = New Recordset
rsUser.Open "select * from TbUser", Modmain.conn, 3, 2
While Not rsUser.EOF
cboUser.AddItem (rsUser.Fields!u_name)
rsUser.MoveNext
Wend
cboUser.AddItem ""
rsUser.Close
Set rsUser = Nothing
lvwLoss.ColumnHeaders.Add , , "持卡人ID", lvwLoss.Width / 4 '配置lvwInstitute控件
lvwLoss.ColumnHeaders.Add , , "挂失日期", lvwLoss.Width / 4
lvwLoss.ColumnHeaders.Add , , "开启日期", lvwLoss.Width / 4
lvwLoss.ColumnHeaders.Add , , "用户名", lvwLoss.Width / 4
lvwLoss.GridLines = True
lvwLoss.Sorted = True
lvwLoss.View = lvwReport
Set rsloss = New Recordset
rsloss.Open "select * from TbLoss,tbuser where use_date>date() or use_date is null and TbLoss.u_id=tbuser.u_id ", Modmain.conn, 3, 2
lblnumber.Caption = rsloss.RecordCount
LoadDate
End Sub
Private Sub LoadDate()
lvwLoss.ListItems.Clear
While Not rsloss.EOF ' 添加相应的 ListItem
Set lItem = lvwLoss.ListItems.Add
lItem.Text = rsloss.Fields("C_ID")
lItem.SubItems(1) = rsloss.Fields("Loss_Date")
If Not rsloss.Fields("Use_Date") Then
lItem.SubItems(2) = rsloss.Fields("Use_Date")
End If
lItem.SubItems(3) = rsloss.Fields!u_name
rsloss.MoveNext
Wend
End Sub
Private Sub DeleteLoss()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -