【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“C销售查询.frm”一文,供大家参考学习
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmsaleSearch
Caption = "销售查询"
ClientHeight = 3930
ClientLeft = 60
ClientTop = 450
ClientWidth = 8700
LinkTopic = "Form1"
ScaleHeight = 3930
ScaleWidth = 8700
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Caption = "销售单信息列表"
Height = 3855
Index = 0
Left = 0
TabIndex = 0
Top = 0
Width = 8655
Begin VB.TextBox txtQuery
Appearance = 0 'Flat
Height = 375
Left = 3360
TabIndex = 10
Text = "请输入查询值"
Top = 360
Width = 1935
End
Begin VB.ComboBox CboQuery
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1080
Style = 2 'Dropdown List
TabIndex = 3
Top = 360
Width = 1935
End
Begin VB.CommandButton CmdSearch
BackColor = &H00C0C0C0&
Caption = "查询"
Height = 420
Left = 7440
Style = 1 'Graphical
TabIndex = 2
Top = 240
Width = 915
End
Begin VB.CommandButton CmdExit
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 420
Left = 7500
Style = 1 'Graphical
TabIndex = 1
Top = 900
Width = 855
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 2055
Left = 120
TabIndex = 4
Top = 1680
Width = 8415
_ExtentX = 14843
_ExtentY = 3625
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "销售单信息列表"
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 375
Left = 4320
TabIndex = 5
Top = 960
Width = 1935
_ExtentX = 3413
_ExtentY = 661
_Version = 393216
Format = 77725697
CurrentDate = 38911
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 1080
TabIndex = 8
Top = 960
Width = 1935
_ExtentX = 3413
_ExtentY = 661
_Version = 393216
Format = 77725697
CurrentDate = 38911
End
Begin VB.Label Label8
Caption = "起始日期:"
Height = 255
Index = 2
Left = 120
TabIndex = 9
Top = 1080
Width = 1095
End
Begin VB.Label Label8
Caption = "结束日期:"
Height = 255
Index = 1
Left = 3360
TabIndex = 7
Top = 1080
Width = 1095
End
Begin VB.Label Label8
Caption = "选择条件:"
Height = 255
Index = 0
Left = 120
TabIndex = 6
Top = 480
Width = 1095
End
End
End
Attribute VB_Name = "frmsaleSearch"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As ADODB.Recordset
Dim SQL As String
Dim msg As String
Private Sub Form_Load()
'初始化查询条件ComboBox
CboQuery.AddItem ("saleID")
CboQuery.AddItem ("customerID")
CboQuery.ListIndex = 0 '默认查询条件为销售单号
End Sub
Private Sub CmdSearch_Click()
'查询操作
Dim colName As String '保存所选择的查询条件
Dim colValue As String '保存所要查询具体的值
Dim strWhere As String
colName = CboQuery.Text '取出条件的值
colValue = txtQuery.Text '取出所要查询的值
strWhere = " where " & colName & " like '%" & colValue & "%'"
SQL = " select * from 销售单表 " & strWhere
SQL = SQL & " and saleDate between '" & Me.DTPicker1.Value & "' "
SQL = SQL & "and '" & Me.DTPicker2.Value & "'"
Set rs = SelectSQL(SQL, msg)
If rs.RecordCount <> 0 Then
Set DataGrid1.DataSource = rs
Else
Set rs = Nothing
End If
End Sub
Private Sub CmdExit_Click()
'退出操作
frmBLMS.Enabled = True
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
'退出操作
frmBLMS.Enabled = True
Unload Me
End Sub
上一篇:
CToolBar3View.cpp
下一篇:
不规则零件优化排样的神经网络混合优化算法