📄 frm_xxcx_tsmydcx.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 Frm_Xxcx_Tsmydcx
Caption = "客户投诉满意度查询"
ClientHeight = 3510
ClientLeft = 60
ClientTop = 345
ClientWidth = 6975
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3510
ScaleWidth = 6975
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 180
Top = 2640
Visible = 0 'False
Width = 1710
_ExtentX = 3016
_ExtentY = 582
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;Persist Security Info=False;User ID=sa;Initial Catalog=db_Client"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_Client"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tb_khxx order by khxx_id"
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 VB.Frame Frame1
Caption = "查询条件"
Height = 600
Left = 15
TabIndex = 1
Top = 15
Width = 6930
Begin VB.CommandButton Cmd_Exit
Caption = "退出"
Height = 300
Left = 6060
TabIndex = 6
Top = 195
Width = 800
End
Begin VB.CommandButton Cmd_Cancel
Caption = "取消"
Height = 300
Left = 5280
TabIndex = 5
Top = 195
Width = 800
End
Begin VB.CommandButton Cmd_Ok
Caption = "确定"
Height = 300
Left = 4500
TabIndex = 4
Top = 195
Width = 800
End
Begin VB.ComboBox Cbx_Oper
Height = 300
Left = 1350
TabIndex = 0
Text = "Cbx_Oper"
Top = 200
Width = 1275
End
Begin VB.ComboBox Cbx_Myd
Height = 300
Left = 2640
TabIndex = 2
Text = "Cbx_Myd"
Top = 200
Width = 1815
End
Begin VB.Label Label1
Caption = "客户满意程度"
Height = 165
Left = 150
TabIndex = 7
Top = 255
Width = 1185
End
End
Begin MSDataGridLib.DataGrid Dgr_Kh
Bindings = "Frm_Xxcx_Tsmydcx.frx":0000
Height = 2820
Left = 15
TabIndex = 3
Top = 660
Width = 6930
_ExtentX = 12224
_ExtentY = 4974
_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
End
Attribute VB_Name = "Frm_Xxcx_Tsmydcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim S1 As String
Dim i As Integer
Dim SQL1 As String
Sub Dgr_Title()
Dgr_Kh.Columns(0).Caption = "客户编号"
Dgr_Kh.Columns(1).Caption = "客户名称"
Dgr_Kh.Columns(2).Caption = "企业性质"
Dgr_Kh.Columns(3).Caption = "企业类型"
Dgr_Kh.Columns(4).Caption = "企业资信"
Dgr_Kh.Columns(5).Caption = "企业地址"
Dgr_Kh.Columns(6).Caption = "所属省份"
Dgr_Kh.Columns(7).Caption = "所属城市"
Dgr_Kh.Columns(8).Caption = "公司邮编"
Dgr_Kh.Columns(9).Caption = "法人代表"
Dgr_Kh.Columns(10).Caption = "开户银行"
Dgr_Kh.Columns(11).Caption = "银行帐号"
Dgr_Kh.Columns(12).Caption = "纳税号"
Dgr_Kh.Columns(13).Caption = "客户IC卡号"
Dgr_Kh.Columns(14).Caption = "公司网址"
Dgr_Kh.Columns(15).Caption = "公司电话"
Dgr_Kh.Columns(16).Caption = "公司传真"
Dgr_Kh.Columns(17).Caption = "主要联系人"
Dgr_Kh.Columns(18).Caption = "联系人电话"
Dgr_Kh.Columns(19).Caption = "客户级别"
Dgr_Kh.Columns(20).Caption = "备注信息"
End Sub
Private Sub Cbx_Myd_GotFocus()
Cbx_Myd.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Myd_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cmd_Ok.SetFocus
End Sub
Private Sub Cbx_Myd_LostFocus()
Cbx_Myd.BackColor = &HFFFFFF
End Sub
Private Sub Cbx_Oper_GotFocus()
Cbx_Oper.BackColor = &HFFFF80
End Sub
Private Sub Cbx_Oper_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then Cbx_Myd.SetFocus
End Sub
Private Sub Cbx_Oper_LostFocus()
Cbx_Oper.BackColor = &HFFFFFF
End Sub
Private Sub Cmd_Cancel_Click() '取消
Cbx_Myd.ListIndex = 0
Cbx_Oper.ListIndex = 0
Cbx_Oper.SetFocus
Adodc1.RecordSource = "select * from tb_khxx order by khxx_id"
Adodc1.Refresh
Set Dgr_Kh.DataSource = Adodc1
Call Dgr_Title
End Sub
Private Sub Cmd_Exit_Click() '退出
Unload Me
End Sub
Private Sub Cmd_Ok_Click()
sql = ""
SQL1 = ""
Dim rs2 As New ADODB.Recordset
rs2.Open "select * from tb_Client_khts where khts_khmyd " & Cbx_Oper & "'" + Cbx_Myd + "'", cnn, adOpenKeyset
If rs2.RecordCount > 0 Then
For i = 0 To rs2.RecordCount - 1
S1 = rs2.Fields("khts_qymc")
If i = 0 Then
sql = "khxx_mc= '" + S1 + "'"
Else
sql = "or khxx_mc='" + S1 + "'"
End If
SQL1 = SQL1 & sql
rs2.MoveNext
Next i
Adodc1.RecordSource = "select * from tb_khxx where " & SQL1
Adodc1.Refresh
Set Dgr_Kh.DataSource = Adodc1
Else
MsgBox "没有符合条件的客户信息,将显示全部信息", , "信息提示"
Adodc1.RecordSource = "select * from tb_khxx "
Adodc1.Refresh
Set Dgr_Kh.DataSource = Adodc1
End If
rs2.Close
Call Dgr_Title
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * from tb_khxx "
Adodc1.Refresh
Set Dgr_Kh.DataSource = Adodc1
Call Dgr_Title '调用过程
Dim rs1 As New ADODB.Recordset
rs1.Open "select * from tb_Client_khmyd", cnn, adOpenKeyset
If rs1.RecordCount > 0 Then
For i = 0 To rs1.RecordCount - 1
Cbx_Myd.AddItem Trim(rs1.Fields("khmyd_myd"))
rs1.MoveNext
Next i
End If
rs1.Close
Cbx_Myd.ListIndex = 0
'向Cbx_Oper中添加查询条件
Cbx_Oper.AddItem ("like")
Cbx_Oper.AddItem (">")
Cbx_Oper.AddItem ("=")
Cbx_Oper.AddItem (">=")
Cbx_Oper.AddItem ("<")
Cbx_Oper.AddItem ("<=")
Cbx_Oper.AddItem ("<>")
Cbx_Oper.ListIndex = 0
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sql = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frm_Main.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -