form19.frm
来自「一个商业软件的源码」· FRM 代码 · 共 2,131 行 · 第 1/5 页
FRM
2,131 行
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
If Text1(Index).Locked = False Then
'Timer3.Enabled = False
Select Case Index
Case 0
Adodc2.RecordSource = "select * from dbo.kuzt"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户状态"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 3
Adodc2.RecordSource = "select * from dbo.khlx"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户类型"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 12
If Text1(3).Text = "关联企业" Then
Adodc2.RecordSource = "select * from dbo.vkehu where 销售=" & "'" & users & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount <> 0 Then
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户中文名称"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
End If
End If
Case 1
Text1(1).Text = Date
DataList1.Visible = False
MonthView1.Visible = True
MonthView1.Value = Date
ks = Index
Case 10
Adodc2.RecordSource = "select * from dbo.khqy"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "所在区域"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 19
Adodc2.RecordSource = "select * from dbo.qyxz"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "企业性质"
DataList1.Top = Text1(Index).Top - DataList1.Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
End Select
Timer3.Enabled = True
End If
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Text1(5).Locked = False Then
If KeyCode = 13 Then
If Index <> Text1.Count - 1 Then
Text1(Index + 1).SetFocus
End If
End If
If Index = Text1.Count - 1 Then
Exit Sub
End If
End If
End Sub
Private Sub Text1_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
If Text1(Index).Locked = True Then
Exit Sub
Select Case Index
Case 9
If KeyCode >= 47 And KeyCode <= 58 Or KeyCode >= 96 And KeyCode <= 106 Or KeyCode = 13 Or KeyCode = 8 Then
Else
Text1(9).Text = ""
End If
Case 1
If KeyCode >= 47 And KeyCode <= 58 Or KeyCode >= 96 And KeyCode <= 106 Or KeyCode = 13 Or KeyCode = 8 Or KeyCode = 189 Then
Else
Text1(1).Text = ""
End If
Case 16
If KeyCode >= 47 And KeyCode <= 58 Or KeyCode >= 96 And KeyCode <= 106 Or KeyCode = 13 Or KeyCode = 8 Or KeyCode = 189 Then
Else
Text1(16).Text = ""
End If
Case 17
If KeyCode >= 47 And KeyCode <= 58 Or KeyCode >= 96 And KeyCode <= 106 Or KeyCode = 13 Or KeyCode = 8 Or KeyCode = 189 Then
Else
Text1(17).Text = ""
End If
End Select
End If
End Sub
Private Sub Text1_LostFocus(Index As Integer)
If Text1(5).Locked = False Then
Select Case Index
Case 5
Call cfjc("zwm")
If Text1(5).Text = "" Then
Image1.Visible = False
Image2.Visible = True
CurtButton7.Enabled = False
End If
Case 6
Call cfjc("ywm")
If Text1(6).Text = "" Then
Image3.Visible = False
Image4.Visible = True
CurtButton7.Enabled = False
End If
End Select
End If
End Sub
Private Sub Timer1_Timer()
cfjc ("zwm")
If Image2.Visible = True Then
CurtButton7.Enabled = False
End If
Timer1.Enabled = False
End Sub
Private Sub Timer2_Timer()
Call cfjc("ywm")
If Image4.Visible = True Then
CurtButton7.Enabled = False
End If
Timer2.Enabled = False
End Sub
Private Sub Timer3_Timer()
DataList1.Visible = False
MonthView1.Visible = False
Timer3.Enabled = False
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
If CurtButton9.Enabled = False Then
If Node.Root <> Node Then
Select Case qx
Case "admin"
Case "user"
If users = Node Then
CurtButton5.Enabled = True
CurtButton6.Enabled = True
CurtButton7.Enabled = True
'CurtButton9.Enabled = True
Else
CurtButton5.Enabled = False
CurtButton6.Enabled = False
CurtButton7.Enabled = False
'CurtButton9.Enabled = False
End If
End Select
Select Case Node.Parent
Case "销售"
If Node = "admin" Then
Adodc1.RecordSource = "select * from dbo.vkehu"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
StatusBar1.Panels(4).Text = Node & "您目前还没有客户!"
Exit Sub
Else
StatusBar1.Panels(4).Text = Node & "您目前有" & Adodc1.Recordset.RecordCount & "家客户!"
End If
Else
Adodc1.RecordSource = "select * from dbo.vkehu where 销售 = " & " '" & Node & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Exit Sub
StatusBar1.Panels(4).Text = Node & "您目前还没有客户!"
Else
StatusBar1.Panels(4).Text = Node & "目前有" & Adodc1.Recordset.RecordCount & "家客户!"
End If
End If
Case "客户所在城市"
Adodc1.RecordSource = "select vkehu.* from dbo.vkehu where 所在城市 = " & " '" & Node & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
StatusBar1.Panels(4).Text = "在" & Node & "没有客户!"
Exit Sub
Else
StatusBar1.Panels(4).Text = "在" & Node & "的客户有" & Adodc1.Recordset.RecordCount & "家!"
End If
Case "客户状态"
Adodc1.RecordSource = "select * from dbo.vkehu where 客户状态 = " & " '" & Node & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Exit Sub
StatusBar1.Panels(4).Text = Node & "没有客户!"
Else
StatusBar1.Panels(4).Text = Node & "的客户有" & Adodc1.Recordset.RecordCount & "家!"
End If
Case "客户类型"
Adodc1.RecordSource = "select * from dbo.vkehu where 客户类型 = " & " '" & Node & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Exit Sub
StatusBar1.Panels(4).Text = Node & "没有客户!"
Else
StatusBar1.Panels(4).Text = Node & "的客户有" & Adodc1.Recordset.RecordCount & "家!"
End If
Case "企业性质"
Adodc1.RecordSource = "select * from dbo.vkehu where 企业性质 = " & " '" & Node & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
Exit Sub
StatusBar1.Panels(4).Text = Node & "没有客户!"
Else
StatusBar1.Panels(4).Text = Node & "的客户有" & Adodc1.Recordset.RecordCount & "家!"
End If
End Select
End If
Else
MsgBox "请先保存!"
End If
End Sub
Public Function bj()
Form1.Refresh
Frame1.Top = Abs(Form1.ScaleHeight - Frame1.Height - 500)
Frame2.Top = Abs(Frame1.Top - Frame2.Height)
TreeView1.Top = CoolBar1.Top + CoolBar1.Height
TreeView1.Height = Abs(Frame2.Top - CoolBar1.Height)
DataGrid1.Top = TreeView1.Top
DataGrid1.Height = TreeView1.Height
DataGrid1.Width = Form1.Width - DataGrid1.Left
Frame2.Width = Form1.Width
Frame1.Width = Form1.Width
End Function
Public Function csh(sf As String)
Select Case sf
Case "admin"
mun_open.Enabled = True
mun_cy.Enabled = True
mun_yhgl.Enabled = True
mun_bf.Enabled = True
mun_dc.Enabled = True
mun_dr.Enabled = True
Case "user"
End Select
End Function
Public Function fqxfy(bh As Boolean)
Dim i As Integer
Dim J As Integer
i = Text1.Count - 1
Select Case bh
Case True
For J = 0 To i
qxfh(J) = ""
Next J
For J = 0 To i
qxfh(J) = Text1(J).Text
Next J
Case False
For J = 0 To i
Text1(J).Text = qxfh(J)
Next J
End Select
End Function
Public Function addtree()
Adodc2.RecordSource = "select * from dbo.users"
Adodc2.Refresh
Do While Not Adodc2.Recordset.EOF
Set nodx = TreeView1.Nodes.Add("xs", tvwChild, , Adodc2.Recordset.Fields(0).Value)
Adodc2.Recordset.MoveNext
Loop
Adodc2.RecordSource = "select * from dbo.khqy"
Adodc2.Refresh
Do While Not Adodc2.Recordset.EOF
Set nodx = TreeView1.Nodes.Add("dq", tvwChild, , Adodc2.Recordset.Fields(0).Value)
Adodc2.Recordset.MoveNext
Loop
Adodc2.RecordSource = "select * from dbo.kuzt"
Adodc2.Refresh
Do While Not Adodc2.Recordset.EOF
Set nodx = TreeView1.Nodes.Add("zt", tvwChild, , Adodc2.Recordset.Fields(0).Value)
Adodc2.Recordset.MoveNext
Loop
Adodc2.RecordSource = "select * from dbo.khlx"
Adodc2.Refresh
Do While Not Adodc2.Recordset.EOF
Set nodx = TreeView1.Nodes.Add("lx", tvwChild, , Adodc2.Recordset.Fields(0).Value)
Adodc2.Recordset.MoveNext
Loop
Adodc2.RecordSource = "select * from dbo.qyxz"
Adodc2.Refresh
Do While Not Adodc2.Recordset.EOF
Set nodx = TreeView1.Nodes.Add("xz", tvwChild, , Adodc2.Recordset.Fields(0).Value)
Adodc2.Recordset.MoveNext
Loop
End Function
Public Function cxkh() As Boolean
Adodc2.RecordSource = "select vkehu.客户中文名称 from dbo.vkehu where vkehu.客户中文名称 like" & "'" & "%" & Text1(5).Text & "%" & "'"
Adodc2.Refresh
End Function
Public Function cfjc(c As String)
Select Case c
Case "zwm"
If Text1(5).Text = "" Then
Image2.Visible = True
Image1.Visible = False
Else
Adodc2.RecordSource = "select * from vkehu where 客户中文名称=" & "'" & Text1(5).Text & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount <> 0 Then
Image2.Visible = True
Image1.Visible = False
CurtButton7.Enabled = False
Else
Image1.Visible = True
Image2.Visible = False
End If
If Image4.Visible = True Then
CurtButton7.Enabled = False
Else
CurtButton7.Enabled = True
End If
End If
Case "ywm"
If Text1(6).Text = "" Then
Image4.Visible = True
Image3.Visible = False
Else
Adodc2.RecordSource = "select * from vkehu where 客户英文名称=" & "'" & Text1(6).Text & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount <> 0 Then
Image4.Visible = True
Image3.Visible = False
CurtButton7.Enabled = False
Else
Image3.Visible = True
Image4.Visible = False
End If
If Image2.Visible = True Then
CurtButton7.Enabled = False
Else
CurtButton7.Enabled = True
End If
End If
End Select
End Function
Public Function sj(a As String)
Select Case a
Case "false"
CurtButton1.Enabled = False
CurtButton2.Enabled = False
CurtButton3.Enabled = False
CurtButton4.Enabled = False
Case "true"
CurtButton1.Enabled = True
CurtButton2.Enabled = True
CurtButton3.Enabled = True
CurtButton4.Enabled = True
End Select
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?