📄 form3.frm
字号:
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1080
TabIndex = 6
Top = 2160
Width = 1575
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "联系电话"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 8160
TabIndex = 4
Top = 1440
Width = 1455
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "联 系 人"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1080
TabIndex = 2
Top = 1440
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "客户名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 1080
TabIndex = 0
Top = 720
Width = 1575
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo 1
If Text1.Text = "" Or Text11.Text = "" Then
MsgBox "未输入客户名称或沟通内容,请核实!", vbExclamation, "系统提示您"
GoTo 1
End If
If Text2 = "" Then
Text2 = "*"
End If
If Text5 = "" Then
Text5 = "*"
End If
If Text6 = "" Then
Text6 = "*"
End If
Adodc2.Recordset.Update
Text18.Text = Text1.Text
Text10.Text = Date + Time
Text19 = Form1.Text7
If Text11 <> "" Then
Adodc3.Recordset.Update
Adodc3.Recordset.AddNew
Else
End If
1 End Sub
Private Sub Command2_Click()
On Error GoTo 81
DataGrid1.Visible = False
Adodc2.Recordset.Update
Adodc2.Recordset.AddNew
Text11 = ""
Text9 = Form1.Text7
GoTo 82
81 MsgBox "客户名称,联系电话,省份,城市必须填写", vbExclamation, "系统提示您"
82 End Sub
Private Sub Command3_Click()
Unload Form3
End Sub
Private Sub Command4_Click()
On Error GoTo 2
Text17 = Trim(Text1) + "%"
Adodc5.RecordSource = "select * from khzl where id like'" & Form1.Text7 & "'and khmc like'" & Text17 & "'"
Adodc5.Refresh
If Adodc5.Recordset.BOF = True And Adodc5.Recordset.EOF = True Then
MsgBox "没有查询到客户资料记录!", vbExclamation, "系统提示您"
GoTo 2
Else
Adodc2.RecordSource = "select * from khzl where id like'" & Form1.Text7 & "'"
Adodc2.Refresh
Set DataGrid1.DataSource = Adodc2
DataGrid1.Visible = True
Set Text16.DataSource = Adodc2
Text16.DataField = "khmc"
Set Text1.DataSource = Adodc2
Text1.DataField = "khmc"
Set Text2.DataSource = Adodc2
Text2.DataField = "lxr"
Set Text3.DataSource = Adodc2
Text3.DataField = "lxdh"
Set Text4.DataSource = Adodc2
Text4.DataField = "dzxx"
Set Text5.DataSource = Adodc2
Text5.DataField = "sf"
Set Text6.DataSource = Adodc2
Text6.DataField = "cs"
Set Text7.DataSource = Adodc2
Text7.DataField = "dz"
Set Text9.DataSource = Adodc2
Text9.DataField = "id"
End If
2 End Sub
Private Sub Command5_Click()
Adodc1.RecordSource = "select sf from khzl where sf<>''and sf<>'*'group by sf"
Set Text13.DataSource = Adodc1
Text13.DataField = "sf"
Set DataGrid2.DataSource = Adodc1
DataGrid2.Visible = True
End Sub
Private Sub Command6_Click()
Adodc4.RecordSource = "select cs from khzl where sf like'" & Text5.Text & "'and cs<>''and cs<>'*'group by cs"
Set Text14.DataSource = Adodc4
Text14.DataField = "cs"
Set DataGrid3.DataSource = Adodc4
DataGrid3.Visible = True
End Sub
Private Sub DataGrid1_Click()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid1_LostFocus()
DataGrid1.Visible = False
End Sub
Private Sub DataGrid2_Click()
DataGrid2.Visible = False
End Sub
Private Sub DataGrid2_LostFocus()
DataGrid2.Visible = False
End Sub
Private Sub DataGrid3_Click()
DataGrid3.Visible = False
End Sub
Private Sub DataGrid3_LostFocus()
DataGrid3.Visible = False
End Sub
Private Sub Form_Click()
DataGrid1.Visible = False
DataGrid2.Visible = False
DataGrid3.Visible = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc6.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc5.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc7.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc4.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc2.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc3.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc8.ConnectionString = "Provider=SQLOLEDB.1;Password=" & Form1.Text6 & ";Persist Security Info=True;User ID=" & Form1.Text5 & ";Initial Catalog=" & Form1.Text8 & ";Data Source=" & Form1.Text4 & ""
Adodc3.RecordSource = "select * from gtqk"
Adodc3.Refresh
Set Text18.DataSource = Adodc3
Text18.DataField = "khmc"
Set Text19.DataSource = Adodc3
Text19.DataField = "khid"
Set Text10.DataSource = Adodc3
Text10.DataField = "gtsj"
Set Text11.DataSource = Adodc3
Text11.DataField = "gtnr"
Set Text23.DataSource = Adodc3
Text23.DataField = "gtcs"
Adodc3.Recordset.AddNew
'Text23 = 1
Adodc2.RecordSource = "select * from khzl"
Adodc2.Refresh
Set Text1.DataSource = Adodc2
Text1.DataField = "khmc"
Set Text2.DataSource = Adodc2
Text2.DataField = "lxr"
Set Text3.DataSource = Adodc2
Text3.DataField = "lxdh"
Set Text4.DataSource = Adodc2
Text4.DataField = "dzxx"
Set Text5.DataSource = Adodc2
Text5.DataField = "sf"
Set Text6.DataSource = Adodc2
Text6.DataField = "cs"
Set Text7.DataSource = Adodc2
Text7.DataField = "dz"
Set Text20.DataSource = Adodc2
Text20.DataField = "yb"
Set Text22.DataSource = Adodc2
Text22.DataField = "bz"
Set Text9.DataSource = Adodc2
Text9.DataField = "id"
Adodc2.Recordset.AddNew
Text9.Text = Form1.Text7.Text
Text15 = 0
End Sub
Private Sub Text1_Change()
Text17 = Trim(Text1) + "%"
End Sub
Private Sub Text1_Click()
DataGrid1.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc5.RecordSource = "select * from khzl where id like'" & Form1.Text7 & "'and khmc like'" & Text17 & "'"
Adodc5.Refresh
If Adodc5.Recordset.BOF = True And Adodc5.Recordset.EOF = True Then
MsgBox "没有查询到客户资料记录!", vbExclamation, "系统提示您"
GoTo 20
Else
Adodc2.RecordSource = "select * from khzl where id like'" & Form1.Text7 & "'and khmc like'" & Text17 & "'"
Adodc2.Refresh
Set DataGrid1.DataSource = Adodc2
DataGrid1.Visible = True
Set Text16.DataSource = Adodc2
Text16.DataField = "khmc"
Set Text1.DataSource = Adodc2
Text1.DataField = "khmc"
Set Text2.DataSource = Adodc2
Text2.DataField = "lxr"
Set Text3.DataSource = Adodc2
Text3.DataField = "lxdh"
Set Text4.DataSource = Adodc2
Text4.DataField = "dzxx"
Set Text5.DataSource = Adodc2
Text5.DataField = "sf"
Set Text6.DataSource = Adodc2
Text6.DataField = "cs"
Set Text7.DataSource = Adodc2
Text7.DataField = "dz"
Set Text20.DataSource = Adodc2
Text20.DataField = "yb"
Set Text22.DataSource = Adodc2
Text22.DataField = "bz"
Set Text9.DataSource = Adodc2
Text9.DataField = "id"
End If
End If
20 End Sub
Private Sub Text1_LostFocus()
Text17 = Trim(Text1) + "%"
End Sub
Private Sub Text11_Click()
If Text15 = "" Then
Text15 = 0
End If
Dim A As String
Dim B As String
Dim c As String
Dim D As String
Dim E As String
B = "%" + Trim(Text1) + "%"
c = "%" + Trim(Text2) + "%"
D = "%" + Trim(Text5) + "%"
E = "%" + Trim(Text6) + "%"
Adodc7.RecordSource = "select a.khmc,b.xm from khzl a,ygdl b where a.khmc like'" & B & "' and a.id=b.id and a.id<>'" & Form1.Text7 & "' and lxr like'" & c & "' and sf like'" & D & "'and cs like'" & E & "'group by a.khmc,b.xm "
Adodc7.Refresh
If Adodc7.Recordset.BOF = True And Adodc7.Recordset.EOF = True Then
Command1.Enabled = True
Adodc3.RecordSource = "select * from gtqk where khmc like'" & Text1.Text & "'"
Adodc3.Refresh
Set Text18.DataSource = Adodc3
Text18.DataField = "khmc"
Set Text19.DataSource = Adodc3
Text19.DataField = "khid"
Set Text10.DataSource = Adodc3
Text10.DataField = "gtsj"
Set Text11.DataSource = Adodc3
Text11.DataField = "gtnr"
Set Text23.DataSource = Adodc3
Text23.DataField = "gtcs"
Adodc3.Recordset.AddNew
Text23 = Text8 + 1
Else
Command1.Enabled = True
Set Text21.DataSource = Adodc7
Text21.DataField = "xm"
A = "该客户已经被" + Trim(Text21) + "登记,你将不能再登记该客户,请核实!"
MsgBox A, vbExclamation, "系统提示您"
Command1.Enabled = False
End If
End Sub
Private Sub Text13_Change()
Text5.Text = Text13
End Sub
Private Sub Text14_Change()
Text6.Text = Text14
End Sub
Private Sub Text15_Change()
Text8.Text = Text15
End Sub
Private Sub Text16_Change()
On Error GoTo 10
Text1.Text = Trim(Text16.Text)
Adodc6.RecordSource = "select max(gmcs) as gmcs from xsqk where khmc like'" & Text1.Text & "'and khid like'" & Form1.Text7 & "'and gmcs<>''"
Adodc6.Refresh
If Adodc6.Recordset.BOF = True And Adodc6.Recordset.EOF = True Then
Text15 = "0"
Else
Set Text15.DataSource = Adodc6
Text15.DataField = "gmcs"
End If
10 End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -