📄 xiaochuocha.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form xiaochuocha
Caption = "销售情况查询"
ClientHeight = 4725
ClientLeft = 6270
ClientTop = 1950
ClientWidth = 8925
ControlBox = 0 'False
Icon = "xiaochuocha.frx":0000
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4725
ScaleWidth = 8925
WindowState = 2 'Maximized
Begin VB.Frame Frame1
Height = 4575
Left = 120
TabIndex = 0
Top = 0
Width = 8685
Begin MSComDlg.CommonDialog CommonDialog1
Left = 7680
Top = 360
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 4080
Width = 8415
_ExtentX = 14843
_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 = "Adodc1"
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 MSDataGridLib.DataGrid DataGrid1
Height = 3135
Left = 120
TabIndex = 11
Top = 840
Width = 8415
_ExtentX = 14843
_ExtentY = 5530
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
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 VB.OptionButton Option1
Caption = "Option1"
Height = 255
Left = 240
TabIndex = 10
Top = 120
Value = -1 'True
Width = 255
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 375
Left = 240
TabIndex = 9
Top = 480
Width = 255
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "xiaochuocha.frx":08CA
Left = 600
List = "xiaochuocha.frx":08D1
TabIndex = 8
Text = "商品名称"
Top = 120
Width = 1215
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "xiaochuocha.frx":08DF
Left = 1800
List = "xiaochuocha.frx":08E6
TabIndex = 7
Text = "="
Top = 120
Width = 615
End
Begin VB.ComboBox Combo3
Height = 300
ItemData = "xiaochuocha.frx":08ED
Left = 2400
List = "xiaochuocha.frx":0900
TabIndex = 6
Text = "请选择查询条件"
Top = 120
Width = 1695
End
Begin VB.ComboBox Combo4
Height = 300
ItemData = "xiaochuocha.frx":0924
Left = 600
List = "xiaochuocha.frx":092B
TabIndex = 5
Text = "销售高场"
Top = 480
Width = 1215
End
Begin VB.ComboBox Combo5
Height = 300
ItemData = "xiaochuocha.frx":0939
Left = 1800
List = "xiaochuocha.frx":0940
TabIndex = 4
Text = "="
Top = 480
Width = 615
End
Begin VB.ComboBox Combo6
Height = 300
ItemData = "xiaochuocha.frx":0947
Left = 2400
List = "xiaochuocha.frx":0960
TabIndex = 3
Text = "请选择查询条件"
Top = 480
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "查 询"
Height = 375
Left = 4320
TabIndex = 2
Top = 360
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "打 印"
Height = 375
Left = 5880
TabIndex = 1
Top = 360
Width = 1215
End
End
End
Attribute VB_Name = "xiaochuocha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Option1 Then
If Combo3.Text = "电话" Then
strcha = " where 商品名称='电话'"
End If
If Combo3.Text = "彩电" Then
strcha = " where 商品名称 = '彩电'"
End If
If Combo3.Text = "电缆" Then
strcha = " where 商品名称 = '电缆'"
End If
If Combo3.Text = "冰箱" Then
strcha = " where 商品名称 = '冰箱'"
End If
If Combo3.Text = "空调器" Then
strcha = " where 商品名称 = '空调器'"
End If
If Combo3.Text = "请选择查询条件" Then
strcha = ""
End If
End If
If Option2 Then
If Combo6.Text = "西单商场" Then
strcha = " where 销售商场='西单商场'"
End If
If Combo6.Text = "双安商场" Then
strcha = " where 销售商场='双安商场'"
End If
If Combo6.Text = "华联商厦" Then
strcha = " where 销售商场='华联商厦'"
End If
If Combo6.Text = "现代商城" Then
strcha = " where 销售商场='现代商城'"
End If
If Combo6.Text = "四季商城" Then
strcha = " where 销售商场='四季商城'"
End If
If Combo6.Text = "帝王大厦" Then
strcha = " where 销售商场='帝王大厦'"
End If
If Combo6.Text = "西湖五金商场" Then
strcha = " where 销售商场='西湖五金商场'"
End If
If Combo6.Text = "请选择查询条件" Then
strcha = ""
End If
End If
strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
strsql = "select * from 销售" & strcha
With rs
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = strconn
.Source = strsql
.LockType = adLockReadOnly
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.Open
End With
Set DataGrid1.DataSource = rs
Set Adodc1.Recordset = rs
lastid = (Adodc1.Recordset.RecordCount + 1)
Adodc1.Caption = "当前记录为:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
With DataGrid1
.Columns(0).Width = 800
.Columns(1).Width = 800
.Columns(2).Width = 900
.Columns(3).Width = 1800
.Columns(4).Width = 1300
.Columns(5).Width = 1000
.Columns(6).Width = 1000
End With
End Sub
Private Sub Command2_Click()
On Error Resume Next
CommonDialog1.ShowPrinter
End Sub
Private Sub Form_Activate()
If wordfindform1 = 1 Then
Unload wordfindform
wordfindform1 = 0
End If
End Sub
Private Sub Form_Load()
xiaochuocha1 = 1
mainmdiform.Toolbar1.Buttons(6).Enabled = False
mainmdiform.Toolbar1.Buttons(8).Enabled = False
mainmdiform.Toolbar1.Buttons(10).Enabled = False
mainmdiform.Toolbar1.Buttons(11).Enabled = False
mainmdiform.StatusBar1.SimpleText = "正在查阅... ...销售表信息查询表单"
strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
strsql = "select * from 销售"
With rs
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = strconn
.Source = strsql
.LockType = adLockOptimistic
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.Open
End With
Set DataGrid1.DataSource = rs
Set Adodc1.Recordset = rs
lastid = (Adodc1.Recordset.RecordCount + 1)
Adodc1.Caption = "当前记录为:" & Adodc1.Recordset.AbsolutePosition & "/" & Adodc1.Recordset.RecordCount
With DataGrid1
.Columns(0).Width = 800
.Columns(1).Width = 800
.Columns(2).Width = 900
.Columns(3).Width = 1800
.Columns(4).Width = 1300
.Columns(5).Width = 1000
.Columns(6).Width = 1000
End With
End Sub
Private Sub Form_Resize()
If xiaochuocha.WindowState = 0 Then
xiaochuocha.WindowState = 2
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
mainmdiform.Toolbar1.Buttons(6).Enabled = True
mainmdiform.Toolbar1.Buttons(8).Enabled = True
mainmdiform.Toolbar1.Buttons(10).Enabled = False
mainmdiform.Toolbar1.Buttons(11).Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -