📄 frmkhdaxg.frm
字号:
VERSION 5.00
Begin VB.Form FrmKHDAXG
BorderStyle = 1 'Fixed Single
Caption = "客户名称修改"
ClientHeight = 3435
ClientLeft = 45
ClientTop = 435
ClientWidth = 5640
ControlBox = 0 'False
LinkTopic = "Form2"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 5640
Begin VB.TextBox TxtName
Appearance = 0 'Flat
ForeColor = &H00FF8080&
Height = 270
Left = 1080
TabIndex = 0
Top = 240
Width = 4215
End
Begin VB.TextBox TxtAddress
Appearance = 0 'Flat
ForeColor = &H00FF8080&
Height = 270
Left = 1080
TabIndex = 1
Top = 720
Width = 4215
End
Begin VB.TextBox TxtLXR
Appearance = 0 'Flat
ForeColor = &H00FF8080&
Height = 270
Left = 1080
TabIndex = 3
Top = 1680
Width = 1575
End
Begin VB.TextBox TxtTele
Appearance = 0 'Flat
ForeColor = &H00FF8080&
Height = 270
Left = 1080
TabIndex = 2
Top = 1200
Width = 4215
End
Begin VB.TextBox TxtBZ
Appearance = 0 'Flat
ForeColor = &H00FF8080&
Height = 615
Left = 1080
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 4
Top = 2100
Width = 4215
End
Begin VB.CommandButton Command1
Caption = "保 存"
Height = 375
Left = 3000
TabIndex = 5
Top = 3000
Width = 855
End
Begin VB.CommandButton Command2
Caption = "取 消"
Height = 375
Left = 4320
TabIndex = 6
Top = 3000
Width = 855
End
Begin VB.Label Label11
Caption = "客户名称:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 11
Top = 240
Width = 975
End
Begin VB.Label Label12
Caption = "客户地址:"
ForeColor = &H00FF0000&
Height = 255
Left = 120
TabIndex = 10
Top = 720
Width = 975
End
Begin VB.Label Label13
Caption = "电话:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 9
Top = 1200
Width = 615
End
Begin VB.Label Label14
Caption = "联系人:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 8
Top = 1680
Width = 735
End
Begin VB.Label Label18
Caption = "备注:"
ForeColor = &H00FF0000&
Height = 255
Left = 240
TabIndex = 7
Top = 2280
Width = 615
End
End
Attribute VB_Name = "FrmKHDAXG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If TxtName.Text = "" Then
MsgBox "请填写客户名称!"
Exit Sub
End If
If TxtAddress.Text = "" Then
MsgBox "请填写客户地址!"
Exit Sub
End If
If TxtTele.Text = "" Then
MsgBox "请填写客户电话!"
Exit Sub
End If
If TxtLXR.Text = "" Then
MsgBox "请填写联系人!"
Exit Sub
End If
Make_Save
FrmKHDA.Show
Unload Me
End Sub
Private Sub Make_Save()
sSql = "SELECT * FROM 客户表 where ID =" & RemId
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
Rs!客户名称 = TxtName.Text
Rs!客户地址 = TxtAddress.Text
Rs!电话 = TxtTele.Text
Rs!联系人 = TxtLXR.Text
If TxtBZ.Text = "" Then Rs!备注 = "-" Else Rs!备注 = TxtBZ.Text
Rs.Update
Rs.Close
End Sub
Private Sub Command2_Click()
FrmKHDA.Show
Unload Me
End Sub
Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Set Rs = New Recordset
Set_Int
End Sub
Private Sub Set_Int()
Dim i As Integer
On Error GoTo DataErr
sSql = "SELECT * FROM 客户表 where ID =" & RemId
Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
TxtName.Text = Rs.Fields("客户名称")
TxtAddress.Text = Rs.Fields("客户地址")
TxtTele.Text = Rs.Fields("电话")
TxtLXR.Text = Rs.Fields("联系人")
If Rs.Fields("备注") = "-" Then TxtBZ.Text = "" Else TxtBZ.Text = Rs.Fields("备注")
Rs.Close
Exit Sub
DataErr:
MsgBox Err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -