⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmquery.vb

📁 对家庭的开支有一个全面的了解和统计
💻 VB
📖 第 1 页 / 共 2 页
字号:
Option Strict Off
Option Explicit On
Friend Class frmquery
	Inherits System.Windows.Forms.Form
#Region "Windows 窗体设计器生成的代码"
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'对于启动窗体,所创建的第一个实例为默认实例。
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'此调用是 Windows 窗体设计器所必需的。
		InitializeComponent()
	End Sub
	'窗体重写处置,以清理组件列表。
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Windows 窗体设计器所必需的
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents opt_date As System.Windows.Forms.RadioButton
	Public WithEvents opt_kind As System.Windows.Forms.RadioButton
	Public WithEvents opt_order As System.Windows.Forms.RadioButton
	Public WithEvents dataset As AxMSHierarchicalFlexGridLib.AxMSHFlexGrid
	Public WithEvents cbokind_qu As System.Windows.Forms.ComboBox
	Public WithEvents cmdquit As System.Windows.Forms.Button
	Public WithEvents cmdsearch As System.Windows.Forms.Button
	Public WithEvents DTPqu_date As AxMSComCtl2.AxDTPicker
	Public WithEvents cboqu_date As System.Windows.Forms.ComboBox
	Public WithEvents cboqu_order As System.Windows.Forms.ComboBox
	Public WithEvents txtqu_order As System.Windows.Forms.TextBox
	Public WithEvents Lbl1 As System.Windows.Forms.Label
	Public WithEvents Lblinfo As System.Windows.Forms.Label
	'注意: 以下过程是 Windows 窗体设计器所必需的
	'可以使用 Windows 窗体设计器来修改它。
	'不要使用代码编辑器修改它。
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmquery))
		Me.components = New System.ComponentModel.Container()
		Me.ToolTip1 = New System.Windows.Forms.ToolTip(components)
		Me.ToolTip1.Active = True
		Me.opt_date = New System.Windows.Forms.RadioButton
		Me.opt_kind = New System.Windows.Forms.RadioButton
		Me.opt_order = New System.Windows.Forms.RadioButton
		Me.dataset = New AxMSHierarchicalFlexGridLib.AxMSHFlexGrid
		Me.cbokind_qu = New System.Windows.Forms.ComboBox
		Me.cmdquit = New System.Windows.Forms.Button
		Me.cmdsearch = New System.Windows.Forms.Button
		Me.DTPqu_date = New AxMSComCtl2.AxDTPicker
		Me.cboqu_date = New System.Windows.Forms.ComboBox
		Me.cboqu_order = New System.Windows.Forms.ComboBox
		Me.txtqu_order = New System.Windows.Forms.TextBox
		Me.Lbl1 = New System.Windows.Forms.Label
		Me.Lblinfo = New System.Windows.Forms.Label
		CType(Me.dataset, System.ComponentModel.ISupportInitialize).BeginInit()
		CType(Me.DTPqu_date, System.ComponentModel.ISupportInitialize).BeginInit()
		Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
		Me.Text = "记录查询"
		Me.ClientSize = New System.Drawing.Size(429, 375)
		Me.Location = New System.Drawing.Point(3, 22)
		Me.MaximizeBox = False
		Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
		Me.BackColor = System.Drawing.SystemColors.Control
		Me.ControlBox = True
		Me.Enabled = True
		Me.KeyPreview = False
		Me.MinimizeBox = True
		Me.Cursor = System.Windows.Forms.Cursors.Default
		Me.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.ShowInTaskbar = True
		Me.HelpButton = False
		Me.WindowState = System.Windows.Forms.FormWindowState.Normal
		Me.Name = "frmquery"
		Me.opt_date.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_date.Text = "开支日期"
		Me.opt_date.Size = New System.Drawing.Size(73, 12)
		Me.opt_date.Location = New System.Drawing.Point(200, 32)
		Me.opt_date.TabIndex = 10
		Me.opt_date.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_date.BackColor = System.Drawing.SystemColors.Control
		Me.opt_date.CausesValidation = True
		Me.opt_date.Enabled = True
		Me.opt_date.ForeColor = System.Drawing.SystemColors.ControlText
		Me.opt_date.Cursor = System.Windows.Forms.Cursors.Default
		Me.opt_date.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.opt_date.Appearance = System.Windows.Forms.Appearance.Normal
		Me.opt_date.TabStop = True
		Me.opt_date.Checked = False
		Me.opt_date.Visible = True
		Me.opt_date.Name = "opt_date"
		Me.opt_kind.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_kind.Text = "开支种类"
		Me.opt_kind.Size = New System.Drawing.Size(73, 17)
		Me.opt_kind.Location = New System.Drawing.Point(0, 56)
		Me.opt_kind.TabIndex = 9
		Me.opt_kind.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_kind.BackColor = System.Drawing.SystemColors.Control
		Me.opt_kind.CausesValidation = True
		Me.opt_kind.Enabled = True
		Me.opt_kind.ForeColor = System.Drawing.SystemColors.ControlText
		Me.opt_kind.Cursor = System.Windows.Forms.Cursors.Default
		Me.opt_kind.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.opt_kind.Appearance = System.Windows.Forms.Appearance.Normal
		Me.opt_kind.TabStop = True
		Me.opt_kind.Checked = False
		Me.opt_kind.Visible = True
		Me.opt_kind.Name = "opt_kind"
		Me.opt_order.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_order.Text = "开支编号"
		Me.opt_order.Size = New System.Drawing.Size(73, 12)
		Me.opt_order.Location = New System.Drawing.Point(0, 32)
		Me.opt_order.TabIndex = 8
		Me.opt_order.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft
		Me.opt_order.BackColor = System.Drawing.SystemColors.Control
		Me.opt_order.CausesValidation = True
		Me.opt_order.Enabled = True
		Me.opt_order.ForeColor = System.Drawing.SystemColors.ControlText
		Me.opt_order.Cursor = System.Windows.Forms.Cursors.Default
		Me.opt_order.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.opt_order.Appearance = System.Windows.Forms.Appearance.Normal
		Me.opt_order.TabStop = True
		Me.opt_order.Checked = False
		Me.opt_order.Visible = True
		Me.opt_order.Name = "opt_order"
		dataset.OcxState = CType(resources.GetObject("dataset.OcxState"), System.Windows.Forms.AxHost.State)
		Me.dataset.Size = New System.Drawing.Size(409, 281)
		Me.dataset.Location = New System.Drawing.Point(8, 88)
		Me.dataset.TabIndex = 7
		Me.dataset.Name = "dataset"
		Me.cbokind_qu.Size = New System.Drawing.Size(113, 20)
		Me.cbokind_qu.Location = New System.Drawing.Point(80, 48)
		Me.cbokind_qu.TabIndex = 6
		Me.cbokind_qu.BackColor = System.Drawing.SystemColors.Window
		Me.cbokind_qu.CausesValidation = True
		Me.cbokind_qu.Enabled = True
		Me.cbokind_qu.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cbokind_qu.IntegralHeight = True
		Me.cbokind_qu.Cursor = System.Windows.Forms.Cursors.Default
		Me.cbokind_qu.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cbokind_qu.Sorted = False
		Me.cbokind_qu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.cbokind_qu.TabStop = True
		Me.cbokind_qu.Visible = True
		Me.cbokind_qu.Name = "cbokind_qu"
		Me.cmdquit.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.cmdquit.Text = "退出"
		Me.cmdquit.Size = New System.Drawing.Size(49, 25)
		Me.cmdquit.Location = New System.Drawing.Point(376, 48)
		Me.cmdquit.TabIndex = 5
		Me.cmdquit.BackColor = System.Drawing.SystemColors.Control
		Me.cmdquit.CausesValidation = True
		Me.cmdquit.Enabled = True
		Me.cmdquit.ForeColor = System.Drawing.SystemColors.ControlText
		Me.cmdquit.Cursor = System.Windows.Forms.Cursors.Default
		Me.cmdquit.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cmdquit.TabStop = True
		Me.cmdquit.Name = "cmdquit"
		Me.cmdsearch.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
		Me.cmdsearch.Text = "查询"
		Me.cmdsearch.Size = New System.Drawing.Size(49, 25)
		Me.cmdsearch.Location = New System.Drawing.Point(312, 48)
		Me.cmdsearch.TabIndex = 4
		Me.cmdsearch.BackColor = System.Drawing.SystemColors.Control
		Me.cmdsearch.CausesValidation = True
		Me.cmdsearch.Enabled = True
		Me.cmdsearch.ForeColor = System.Drawing.SystemColors.ControlText
		Me.cmdsearch.Cursor = System.Windows.Forms.Cursors.Default
		Me.cmdsearch.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cmdsearch.TabStop = True
		Me.cmdsearch.Name = "cmdsearch"
		DTPqu_date.OcxState = CType(resources.GetObject("DTPqu_date.OcxState"), System.Windows.Forms.AxHost.State)
		Me.DTPqu_date.Size = New System.Drawing.Size(97, 18)
		Me.DTPqu_date.Location = New System.Drawing.Point(328, 24)
		Me.DTPqu_date.TabIndex = 3
		Me.DTPqu_date.Name = "DTPqu_date"
		Me.cboqu_date.Size = New System.Drawing.Size(49, 20)
		Me.cboqu_date.Location = New System.Drawing.Point(272, 24)
		Me.cboqu_date.Items.AddRange(New Object(){"=", "<", ">", ">=", "<=", "<>"})
		Me.cboqu_date.TabIndex = 2
		Me.cboqu_date.BackColor = System.Drawing.SystemColors.Window
		Me.cboqu_date.CausesValidation = True
		Me.cboqu_date.Enabled = True
		Me.cboqu_date.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cboqu_date.IntegralHeight = True
		Me.cboqu_date.Cursor = System.Windows.Forms.Cursors.Default
		Me.cboqu_date.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cboqu_date.Sorted = False
		Me.cboqu_date.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.cboqu_date.TabStop = True
		Me.cboqu_date.Visible = True
		Me.cboqu_date.Name = "cboqu_date"
		Me.cboqu_order.Size = New System.Drawing.Size(41, 20)
		Me.cboqu_order.Location = New System.Drawing.Point(80, 24)
		Me.cboqu_order.Items.AddRange(New Object(){"=", ">", "<", "<=", ">=", "<>"})
		Me.cboqu_order.TabIndex = 1
		Me.cboqu_order.BackColor = System.Drawing.SystemColors.Window
		Me.cboqu_order.CausesValidation = True
		Me.cboqu_order.Enabled = True
		Me.cboqu_order.ForeColor = System.Drawing.SystemColors.WindowText
		Me.cboqu_order.IntegralHeight = True
		Me.cboqu_order.Cursor = System.Windows.Forms.Cursors.Default
		Me.cboqu_order.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.cboqu_order.Sorted = False
		Me.cboqu_order.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
		Me.cboqu_order.TabStop = True
		Me.cboqu_order.Visible = True
		Me.cboqu_order.Name = "cboqu_order"
		Me.txtqu_order.AutoSize = False
		Me.txtqu_order.Size = New System.Drawing.Size(65, 18)
		Me.txtqu_order.Location = New System.Drawing.Point(128, 24)
		Me.txtqu_order.TabIndex = 0
		Me.txtqu_order.AcceptsReturn = True
		Me.txtqu_order.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
		Me.txtqu_order.BackColor = System.Drawing.SystemColors.Window
		Me.txtqu_order.CausesValidation = True
		Me.txtqu_order.Enabled = True
		Me.txtqu_order.ForeColor = System.Drawing.SystemColors.WindowText
		Me.txtqu_order.HideSelection = True
		Me.txtqu_order.ReadOnly = False
		Me.txtqu_order.Maxlength = 0
		Me.txtqu_order.Cursor = System.Windows.Forms.Cursors.IBeam
		Me.txtqu_order.MultiLine = False
		Me.txtqu_order.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.txtqu_order.ScrollBars = System.Windows.Forms.ScrollBars.None
		Me.txtqu_order.TabStop = True
		Me.txtqu_order.Visible = True
		Me.txtqu_order.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
		Me.txtqu_order.Name = "txtqu_order"
		Me.Lbl1.Size = New System.Drawing.Size(113, 33)
		Me.Lbl1.Location = New System.Drawing.Point(200, 48)
		Me.Lbl1.TabIndex = 12
		Me.Lbl1.TextAlign = System.Drawing.ContentAlignment.TopLeft
		Me.Lbl1.BackColor = System.Drawing.SystemColors.Control
		Me.Lbl1.Enabled = True
		Me.Lbl1.ForeColor = System.Drawing.SystemColors.ControlText
		Me.Lbl1.Cursor = System.Windows.Forms.Cursors.Default
		Me.Lbl1.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Lbl1.UseMnemonic = True
		Me.Lbl1.Visible = True
		Me.Lbl1.AutoSize = False
		Me.Lbl1.BorderStyle = System.Windows.Forms.BorderStyle.None
		Me.Lbl1.Name = "Lbl1"
		Me.Lblinfo.Text = "查询提示:请先选择查询类别,然后选查询条件,再按查询按钮!"
		Me.Lblinfo.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
		Me.Lblinfo.ForeColor = System.Drawing.Color.Blue
		Me.Lblinfo.Size = New System.Drawing.Size(497, 17)
		Me.Lblinfo.Location = New System.Drawing.Point(0, 0)
		Me.Lblinfo.TabIndex = 11
		Me.Lblinfo.TextAlign = System.Drawing.ContentAlignment.TopLeft
		Me.Lblinfo.BackColor = System.Drawing.SystemColors.Control
		Me.Lblinfo.Enabled = True
		Me.Lblinfo.Cursor = System.Windows.Forms.Cursors.Default
		Me.Lblinfo.RightToLeft = System.Windows.Forms.RightToLeft.No
		Me.Lblinfo.UseMnemonic = True
		Me.Lblinfo.Visible = True
		Me.Lblinfo.AutoSize = False
		Me.Lblinfo.BorderStyle = System.Windows.Forms.BorderStyle.None
		Me.Lblinfo.Name = "Lblinfo"
		Me.Controls.Add(opt_date)
		Me.Controls.Add(opt_kind)
		Me.Controls.Add(opt_order)
		Me.Controls.Add(dataset)
		Me.Controls.Add(cbokind_qu)
		Me.Controls.Add(cmdquit)
		Me.Controls.Add(cmdsearch)
		Me.Controls.Add(DTPqu_date)
		Me.Controls.Add(cboqu_date)
		Me.Controls.Add(cboqu_order)
		Me.Controls.Add(txtqu_order)
		Me.Controls.Add(Lbl1)
		Me.Controls.Add(Lblinfo)
		CType(Me.DTPqu_date, System.ComponentModel.ISupportInitialize).EndInit()
		CType(Me.dataset, System.ComponentModel.ISupportInitialize).EndInit()
	End Sub
#End Region 
#Region "升级支持"
	Private Shared m_vb6FormDefInstance As frmquery
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As frmquery
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New frmquery()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	Dim db As DAO.Database
	Dim rs As DAO.Recordset '所有的记录
	Dim rs1 As DAO.Recordset '所有记录的种类列表
	Dim txtsql As String
	Dim rs2 As DAO.Recordset '按编号查询的记录集
	Dim rs3 As DAO.Recordset '按日期查询的记录集
	Dim rs4 As DAO.Recordset '按种类查询的记录集
	'以下一段代码是实现按编号查询
	Sub query_order()
		rs.Index = ("pay_order")
		db = DAODBEngine_definst.OpenDatabase("d:\data\payout.mdb")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -