📄 frmcgcx.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"
Begin VB.Form frmCGCX
BorderStyle = 1 'Fixed Single
Caption = "采购查询"
ClientHeight = 6465
ClientLeft = 45
ClientTop = 435
ClientWidth = 10440
Icon = "frmCGCX.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmCGCX.frx":29C12
ScaleHeight = 6465
ScaleWidth = 10440
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 5640
TabIndex = 10
Top = 2040
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "查询"
Height = 375
Left = 3000
TabIndex = 9
Top = 2040
Width = 1455
End
Begin VB.Frame Frame1
Caption = "请选择查询条件"
Height = 1695
Left = 120
TabIndex = 1
Top = 120
Width = 10095
Begin VB.TextBox Text2
Height = 270
Left = 4560
TabIndex = 8
Top = 1200
Width = 5295
End
Begin VB.TextBox Text1
Height = 270
Left = 4560
TabIndex = 7
Top = 240
Width = 5295
End
Begin VB.ComboBox Combo5
Height = 300
Left = 3000
TabIndex = 6
Top = 1200
Width = 1215
End
Begin VB.ComboBox Combo4
Height = 300
Left = 240
TabIndex = 5
Top = 1200
Width = 2535
End
Begin VB.ComboBox Combo3
Height = 300
Left = 1920
TabIndex = 4
Top = 720
Width = 1695
End
Begin VB.ComboBox Combo2
Height = 300
Left = 3000
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 300
Left = 240
TabIndex = 2
Top = 240
Width = 2535
End
End
Begin MSDataGridLib.DataGrid dgdCGCX
Bindings = "frmCGCX.frx":3D900
Height = 3975
Left = 0
TabIndex = 0
Top = 2520
Width = 10455
_ExtentX = 18441
_ExtentY = 7011
_Version = 393216
AllowUpdate = 0 'False
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 MSAdodcLib.Adodc adoCGCX
Height = 375
Left = 9000
Top = 2040
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Password=ecc;Persist Security Info=True;User ID=sa;Initial Catalog=PetrolStation System;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Password=ecc;Persist Security Info=True;User ID=sa;Initial Catalog=PetrolStation System;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from PS_Purchases"
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
End
Attribute VB_Name = "frmCGCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo myerr
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Then
If MsgBox("请输入查询条件!", vbInformation, "提示") Then GoTo myerr
End If
adoCGCX.CommandType = adCmdText
adoCGCX.RecordSource = "select * from PS_Purchases where " & _
Trim(Combo1.Text) & Trim(Combo2.Text) & " '" & Trim(Text1.Text) _
& "'" & " " & Trim(Combo3.Text) & " " & Trim(Combo4.Text) & _
Trim(Combo5.Text) & "'" & Trim(Text2.Text) & "'"
adoCGCX.Refresh
myerr:
End Sub
Private Sub Form_Load()
adoCGCX.CommandType = adCmdText
adoCGCX.RecordSource = "select * from PS_Purchases"
adoCGCX.Refresh
'添加Combo1的子项作为查询标准
Combo1.AddItem ("油品名称")
Combo1.AddItem ("供应商")
Combo1.AddItem ("经手人")
Combo1.AddItem ("票号")
Combo1.AddItem ("数量")
Combo1.ListIndex = 0
'添加Combo2的子项作为关系符
Combo2.AddItem ("=")
Combo2.AddItem (">")
Combo2.AddItem (">=")
Combo2.AddItem ("<")
Combo2.AddItem ("<=")
Combo2.AddItem ("<>")
Combo2.ListIndex = 0
'添加Combo3的子项作为逻辑连接符
Combo3.AddItem ("AND")
Combo3.AddItem ("OR")
Combo3.ListIndex = 0
'添加Combo4的子项作为第二种查询标准
Combo4.AddItem ("油品名称")
Combo4.AddItem ("供应商")
Combo4.AddItem ("经手人")
Combo4.AddItem ("票号")
Combo4.AddItem ("数量")
Combo4.ListIndex = 0
'添加Combo5的子项作为第二种关系符
Combo5.AddItem ("=")
Combo5.AddItem (">")
Combo5.AddItem (">=")
Combo5.AddItem ("<")
Combo5.AddItem ("<=")
Combo5.AddItem ("<>")
Combo5.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.Enabled = True
frmMain.Show
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -