📄 main_sckh.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form main_sckh
BorderStyle = 3 'Fixed Dialog
Caption = "数据管理-〖删除客户〗"
ClientHeight = 2685
ClientLeft = 45
ClientTop = 330
ClientWidth = 6765
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2685
ScaleWidth = 6765
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 1950
Left = 120
TabIndex = 2
Top = 120
Width = 6135
Begin VB.ComboBox Combo1
Height = 300
Left = 1520
TabIndex = 8
Top = 480
Width = 4400
End
Begin VB.TextBox Text1
Height = 300
Left = 1515
Locked = -1 'True
TabIndex = 4
Top = 1320
Width = 4400
End
Begin VB.TextBox Text2
Height = 300
Left = 1515
Locked = -1 'True
TabIndex = 3
Top = 910
Width = 4400
End
Begin VB.Label Label1
Caption = "客户全称"
Height = 315
Left = 120
TabIndex = 7
Top = 960
Width = 1740
End
Begin VB.Label Label2
Caption = "请输入客户编号"
Height = 315
Left = 120
TabIndex = 6
Top = 480
Width = 1740
End
Begin VB.Label Label3
Caption = "客户所属地区"
Height = 255
Left = 120
TabIndex = 5
Top = 1440
Width = 1260
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1080
Top = 3000
Visible = 0 'False
Width = 1920
_ExtentX = 3387
_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=Microsoft.Jet.OLEDB.4.0;Data Source=khgl.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=khgl.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from kh"
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.CommandButton Command3
Caption = "退出"
Height = 405
Left = 4720
TabIndex = 1
Top = 2160
Width = 1530
End
Begin VB.CommandButton Command2
Caption = "删除"
Enabled = 0 'False
Height = 405
Left = 3120
TabIndex = 0
Top = 2160
Width = 1530
End
End
Attribute VB_Name = "main_sckh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Combo1_Click()
Adodc1.RecordSource = "select * from kh where (kh.客户编号 LIKE'%" + Combo1.Text + "%')"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "查无此数据!"
Else
Text1.Text = Adodc1.Recordset.Fields("所属地区")
Text2.Text = Adodc1.Recordset.Fields("客户全称")
Command2.Enabled = True
End If
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "select * from kh"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Do While Adodc1.Recordset.EOF = False
Combo1.AddItem (Adodc1.Recordset.Fields("客户编号"))
Adodc1.Recordset.MoveNext
Loop
Else
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then Text2.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyDown Then Combo1.SetFocus
If KeyCode = vbKeyUp Then Text1.SetFocus
End Sub
Private Sub Command2_Click()
Dim myval As String
If Adodc1.Recordset.RecordCount <> 0 Then
myval = MsgBox("确实要删除该客户吗?", vbYesNo)
If myval = vbYes Then
Adodc1.Recordset.Delete
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
End If
Else
MsgBox "查无此数据!"
End If
End Sub
Private Sub Command3_Click()
frm_main.Enabled = True
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -