📄 frm_交费查询.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomct2.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "Msadodc.OCX"
Object = "{715CBE0F-4F50-46EF-B009-CACED3A5C865}#3.0#0"; "gregn3.dll"
Begin VB.Form Frm_交费查询
Caption = "交费查询"
ClientHeight = 6150
ClientLeft = 60
ClientTop = 345
ClientWidth = 10350
KeyPreview = -1 'True
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6150
ScaleWidth = 10350
WindowState = 2 'Maximized
Begin VB.CommandButton CmdOut
Caption = "输出(&O)"
Height = 330
Left = 7680
TabIndex = 13
Top = 960
Width = 960
End
Begin MSAdodcLib.Adodc Adocp
Height = 375
Left = 1440
Top = 2040
Visible = 0 'False
Width = 1695
_ExtentX = 2990
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "产品"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adogx
Height = 330
Left = 6120
Top = 2280
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "工序"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Caption = "查询条件:"
Height = 735
Left = 240
TabIndex = 8
Top = 120
Width = 9375
Begin VB.TextBox txtName
Height = 330
Left = 3600
TabIndex = 1
Top = 285
Width = 1335
End
Begin VB.TextBox txtID
Height = 330
Left = 1080
TabIndex = 0
Top = 285
Width = 1335
End
Begin MSComCtl2.DTPicker DTpto
Height = 330
Left = 7440
TabIndex = 3
Top = 285
Width = 1455
_ExtentX = 2566
_ExtentY = 582
_Version = 393216
CustomFormat = "yyyy 年 MM月"
Format = 24707075
UpDown = -1 'True
CurrentDate = 38949
End
Begin MSComCtl2.DTPicker DTPfrom
Height = 330
Left = 5520
TabIndex = 2
Top = 285
Width = 1455
_ExtentX = 2566
_ExtentY = 582
_Version = 393216
CustomFormat = "yyyy 年 MM月"
Format = 24707075
UpDown = -1 'True
CurrentDate = 38681
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "用户姓名:"
Height = 180
Left = 2640
TabIndex = 12
Top = 360
Width = 810
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户编号:"
Height = 180
Left = 240
TabIndex = 11
Top = 360
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "到:"
Height = 180
Left = 7080
TabIndex = 10
Top = 360
Width = 360
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "从:"
Height = 180
Left = 5160
TabIndex = 9
Top = 360
Width = 360
End
End
Begin VB.CommandButton CmdPrint
Caption = "打印(&P)"
Height = 330
Left = 6720
TabIndex = 7
Top = 960
Width = 960
End
Begin VB.CommandButton CmdExit
Caption = "退出(&X)"
Height = 330
Left = 8640
TabIndex = 6
Top = 960
Width = 960
End
Begin VB.CommandButton Cmdfind
Caption = "查询(&Q)"
Height = 330
Left = 5760
TabIndex = 5
Top = 960
Width = 960
End
Begin grproLibCtl.GRDisplayViewer grdvRate
Height = 4650
Left = 240
TabIndex = 4
Top = 1440
Width = 9975
BorderStyle = 1
ShowHeader = -1 'True
ShowFooter = -1 'True
LeftGap = 0
RightGap = 0
TopGap = 0
BottomGap = 0
GridTitle3D = 0 'False
Resortable = 0 'False
ResortCaseSensitive= 0 'False
ResortDefaultAsc= -1 'True
End
End
Attribute VB_Name = "Frm_交费查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strcnn As New ADODB.Connection
Dim WithEvents Report As grproLibCtl.GridppReport
Attribute Report.VB_VarHelpID = -1
Dim rsfind As New ADODB.Recordset
Dim strgxname, strRpt As String
Dim strf() As String
Private Sub Cmdexit_Click()
Unload Me
End Sub
Private Sub CmdFind_Click()
Dim strsql As String
'日期范围
strsql = "select * from v_交费查询 where 月份 >='" & Format(DTPfrom.Value, "yymm") & "' and 月份 <= '" & Format(DTpto.Value, "yymm") & "'"
If Trim(txtid.Text) <> "" Then
strsql = strsql & " and 用户编号='" & Trim(txtid.Text) & "' "
End If
If Trim(txtName.Text) <> "" Then
strsql = strsql & " and 姓名 like '%" & Trim(txtName.Text) & "%'"
End If
Debug.Print strsql
With rsfind
If .State = adStateOpen Then .Close
.Open strsql, strcnn, adOpenKeyset, adLockReadOnly
If .RecordCount = 0 Then
MsgBox "在您查询的用户的用户记录在数据库中未能查询到!", , "系统提示"
'Report.DetailGrid.Recordset.Empty
grdvRate.Stop
Report.Clear
grdvRate.Refresh
Exit Sub
End If
End With
grdvRate.Stop
Report.Clear
Report.LoadFromFile App.Path & "\模板\交费查询.grf"
Report.DetailGrid.Recordset.SkipQuery = True
grdvRate.Stop
grdvRate.Report = Report
grdvRate.Start
Start True
End Sub
Private Sub CmdOut_Click()
Report.ExportDirect gretXLS, App.Path, True
End Sub
Private Sub CmdPrint_Click()
Report.PrintPreview True
End Sub
Private Sub Form_Load()
Dim rsrpt As New ADODB.Recordset
Dim strsql As String
'frm_main.Toolbar1.Visible = False
If strcnn.State = adStateOpen Then strcnn.Close
strcnn.Open cnn
Set Report = New grproLibCtl.GridppReport
'Report.LoadFromFile App.Path & "\模板\交费查询.grf"
' grdvRate.Report = Report
' grdvRate.Refresh
DTPfrom.Value = Format(Now() - 31, "yyyy 年 MM月")
DTpto.Value = Format(Now(), "yyyy 年 MM月")
Cmdfind.Enabled = True
CmdPrint.Enabled = False
'grdvRate.Refresh
Start False
End Sub
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then grdvRate.Move 0, grdvRate.top, ScaleWidth, ScaleHeight - grdvRate.top
End Sub
Private Sub Report_FetchRecord(pEof As Boolean)
If rsfind.State = adStateOpen Then GRFetchRecordFromRecordset Report, rsfind
End Sub
Private Function Start(isCanUse As Boolean) 'iscanuse 是真时是初始状态,添加按钮可用
Me.KeyPreview = isCanUse
Cmdfind.Enabled = True
CmdPrint.Enabled = isCanUse
CmdExit.Enabled = True
CmdOut.Enabled = isCanUse
End Function
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyRight Then keybd_event 9, 0, 0, 0
If KeyCode = vbKeyLeft Then
keybd_event 9, 1, 1, 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -