📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Appearance = 0 'Flat
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "查询"
ClientHeight = 4545
ClientLeft = 45
ClientTop = 330
ClientWidth = 4635
LinkTopic = "Form4"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4545
ScaleWidth = 4635
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 4
Left = 1920
TabIndex = 12
Top = 2520
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 3
Left = 1920
TabIndex = 11
Top = 2040
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 2
Left = 1920
TabIndex = 10
Top = 1560
Width = 1695
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 1
Left = 1920
MaxLength = 50
TabIndex = 9
Top = 1080
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 255
Left = 3000
TabIndex = 8
Top = 3480
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 255
Left = 960
TabIndex = 7
Top = 3480
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H80000018&
ForeColor = &H000000FF&
Height = 255
Index = 0
Left = 1920
MaxLength = 50
TabIndex = 0
Text = " "
Top = 600
Width = 1695
End
Begin VB.Label Label6
Caption = "回访人:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Index = 0
Left = 960
TabIndex = 5
Top = 2520
Width = 975
End
Begin VB.Label Label5
Caption = "初访人:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 960
TabIndex = 4
Top = 2040
Width = 975
End
Begin VB.Label Label3
Caption = "客户档案查询"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 6
Top = 0
Width = 2175
End
Begin VB.Label Label1
Caption = "公司名称:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 1
Top = 600
Width = 1335
End
Begin VB.Label Label2
Caption = "公司地址:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Left = 840
TabIndex = 2
Top = 1080
Width = 1815
End
Begin VB.Label Label4
Caption = "资料查询者:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 255
Index = 0
Left = 600
TabIndex = 3
Top = 1560
Width = 1335
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim aa As Integer
txtsql = ""
If Text1(0).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "custom.公司名称='" & Text1(0).Text & "'"
Else
txtsql = txtsql & "and custom.公司名称='" & Text1(0).Text & "'"
End If
End If
If Text1(1).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "custom.公司地址 like '%" & Text1(1).Text & "'"
Else
txtsql = txtsql & "and custom.公司地址='" & Text1(1).Text & "'"
End If
End If
If Text1(2).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "custom.资料查询者='" & Text1(2).Text & "'"
Else
txtsql = txtsql & "and custom.资料查询者='" & Text1(2).Text & "'"
End If
End If
If Text1(3).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "custom.初访人='" & Text1(3).Text & "'"
Else
txtsql = txtsql & "and custom.初访人='" & Text1(3).Text & "'"
End If
End If
If Text1(4).Text <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "custom.回访人='" & Text1(4).Text & "'"
Else
txtsql = txtsql & "and custom.回访人='" & Text1(4).Text & "'"
End If
End If
If aa = 0 Then
ss = MsgBox("你至少要输入一个条件以上才能查询!", , " 警告")
Text1(0).SetFocus
Exit Sub
End If
Dim str As String
str = "select * from custom where " & txtsql
Dim mrc As ADODB.Recordset
Set mrc = ExecuteSQL(str)
If mrc.EOF = True Then
zzz = MsgBox("对不起,没有此客户的档案记录!", vbOKOnly, "查询")
Form4.ZOrder (0)
Form4.Text1(0).SetFocus
Exit Sub
End If
txtsql = "select custom.公司名称, custom.公司地址, custom.部门名称, custom.负责人, custom.电话, custom.传真, custom.邮箱, custom.网址, custom.公司主营, custom.资料渠道, custom.资料查询者, custom.初访时间,custom.初访人,custom.制图软件,custom.设计电脑台数,custom.设计人数,custom.回访时间,custom.回访人,custom.试用时间,custom.采购时间,custom.点/台数,custom.版本,custom.备注 from custom where " & txtsql & "order by custom.公司名称 desc"
Form3.printstr = txtsql
find = True
Form3.Show
Form3.Caption = "客户档案查询结果"
Form3.showtitle
Form3.showdata
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
find = True
End Sub
Private Sub Form_LostFocus()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
find = False
'Form3.Caption = "浏览客户档案"
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 39 Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -