📄 frmaddclient.frm
字号:
VERSION 5.00
Begin VB.Form frmAddClient
Caption = "添加客户"
ClientHeight = 4215
ClientLeft = 60
ClientTop = 345
ClientWidth = 5760
LinkTopic = "Form1"
ScaleHeight = 4215
ScaleWidth = 5760
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Caption = "返回(&C)"
Height = 375
Left = 3120
TabIndex = 14
Top = 3720
Width = 1215
End
Begin VB.CommandButton cmdAdd
Caption = "添加(&A)"
Height = 375
Left = 1320
TabIndex = 13
Top = 3720
Width = 1335
End
Begin VB.Frame Frame1
Caption = "客户信息"
Height = 3375
Left = 120
TabIndex = 0
Top = 120
Width = 5535
Begin VB.TextBox txtInfo
Height = 285
Index = 4
Left = 1200
TabIndex = 16
Top = 1320
Width = 4095
End
Begin VB.TextBox txtInfo
Height = 855
Index = 6
Left = 1200
TabIndex = 12
Top = 2280
Width = 4095
End
Begin VB.TextBox txtInfo
Height = 285
Index = 5
Left = 1200
TabIndex = 10
Top = 1800
Width = 4095
End
Begin VB.TextBox txtInfo
Height = 285
Index = 3
Left = 3600
TabIndex = 8
Top = 840
Width = 1695
End
Begin VB.TextBox txtInfo
Height = 285
Index = 1
Left = 3600
TabIndex = 6
Top = 330
Width = 1695
End
Begin VB.TextBox txtInfo
Height = 285
Index = 2
Left = 1200
TabIndex = 4
Top = 840
Width = 1215
End
Begin VB.TextBox txtInfo
Height = 285
Index = 0
Left = 1200
TabIndex = 2
Top = 360
Width = 1215
End
Begin VB.Label Label7
Caption = "产品范围:"
Height = 255
Left = 240
TabIndex = 15
Top = 1320
Width = 975
End
Begin VB.Label Label6
Caption = "备 注:"
Height = 255
Left = 240
TabIndex = 11
Top = 2280
Width = 975
End
Begin VB.Label Label5
Caption = "通信地址:"
Height = 255
Left = 240
TabIndex = 9
Top = 1800
Width = 975
End
Begin VB.Label Label4
Caption = "电子邮件:"
Height = 255
Left = 2640
TabIndex = 7
Top = 840
Width = 975
End
Begin VB.Label Label3
Caption = "电话号码:"
Height = 255
Left = 2640
TabIndex = 5
Top = 360
Width = 1095
End
Begin VB.Label Label2
Caption = "联 系 人:"
Height = 375
Left = 240
TabIndex = 3
Top = 840
Width = 1095
End
Begin VB.Label Label1
Caption = "客户名称:"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 975
End
End
End
Attribute VB_Name = "frmAddClient"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public sqlStr As String
Public msgText As String
Private Sub cmdAdd_Click()
Dim rstClient As ADODB.Recordset
Dim i As Integer
For i = 0 To 3
If txtInfo(i).Text = "" Then
MsgBox "请将信息填写完整", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
Next i
'添加新记录
sqlStr = "select * from client"
Set rstClient = ExecuteSQL(sqlStr, msgText)
rstClient.AddNew
rstClient.Fields("clientName") = txtInfo(0).Text
rstClient.Fields("telno") = txtInfo(1).Text
rstClient.Fields("contact") = txtInfo(2).Text
rstClient.Fields("email") = txtInfo(3).Text
rstClient.Fields("products") = txtInfo(4).Text
rstClient.Fields("address") = txtInfo(5).Text
rstClient.Fields("memo") = txtInfo(6).Text
rstClient.Update
rstClient.Close
MsgBox "客户信息添加完成!", vbOKOnly + vbExclamation, "警告"
For i = 0 To 6
txtInfo(i).Text = ""
Next i
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -