📄 frmkuhulogin.frm
字号:
VERSION 5.00
Begin VB.Form Frmkehulogin
BackColor = &H00C0FFFF&
Caption = "客户资料登记"
ClientHeight = 8160
ClientLeft = 60
ClientTop = 450
ClientWidth = 9780
LinkTopic = "Form6"
MaxButton = 0 'False
Picture = "FRMKUH~1.frx":0000
ScaleHeight = 8160
ScaleWidth = 9780
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox gridkehu
Height = 3135
Left = 240
ScaleHeight = 3075
ScaleWidth = 9195
TabIndex = 29
Top = 120
Width = 9255
End
Begin VB.Frame Frame1
BackColor = &H00C0FFFF&
Caption = "客户资料登记"
Height = 4575
Left = 240
TabIndex = 0
Top = 3360
Width = 9255
Begin VB.CommandButton cmdexit
Caption = "退出"
Height = 375
Left = 6480
TabIndex = 28
Top = 3960
Width = 1095
End
Begin VB.CommandButton cmddel
Caption = "删除"
Height = 375
Left = 4800
TabIndex = 27
Top = 3960
Width = 1095
End
Begin VB.CommandButton cmdmodify
Caption = "修改"
Height = 375
Left = 3120
TabIndex = 26
Top = 3960
Width = 1095
End
Begin VB.CommandButton cmdadd
Caption = "增加"
Height = 375
Left = 1440
TabIndex = 25
Top = 3960
Width = 1095
End
Begin VB.TextBox txtbeizhu
Height = 2895
Left = 6480
TabIndex = 24
Top = 840
Width = 2295
End
Begin VB.TextBox txtduty
Height = 375
Left = 3840
TabIndex = 23
Top = 3360
Width = 2175
End
Begin VB.TextBox txtadd
Height = 375
Left = 1200
TabIndex = 22
Top = 2160
Width = 4815
End
Begin VB.TextBox txtcard
Height = 375
Left = 3840
TabIndex = 21
Top = 1560
Width = 2175
End
Begin VB.TextBox txtemail
Height = 375
Left = 3840
TabIndex = 20
Top = 960
Width = 2175
End
Begin VB.PictureBox DTPicker1
Height = 375
Left = 3840
ScaleHeight = 315
ScaleWidth = 2115
TabIndex = 19
Top = 360
Width = 2175
End
Begin VB.TextBox txtyoubian
Height = 375
Left = 1200
TabIndex = 18
Top = 3360
Width = 1455
End
Begin VB.TextBox txtcell
Height = 375
Left = 1200
TabIndex = 17
Top = 2760
Width = 1455
End
Begin VB.TextBox txttel
Height = 375
Left = 3840
TabIndex = 16
Top = 2760
Width = 2175
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1200
Style = 2 'Dropdown List
TabIndex = 15
Top = 1560
Width = 1455
End
Begin VB.TextBox txtname
Height = 375
Left = 1200
TabIndex = 14
Top = 960
Width = 1455
End
Begin VB.TextBox txtID
Height = 375
Left = 1200
TabIndex = 13
Top = 360
Width = 1455
End
Begin VB.Label Label12
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "备注:"
Height = 180
Left = 6480
TabIndex = 12
Top = 480
Width = 540
End
Begin VB.Label Label11
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "邮编:"
Height = 180
Left = 600
TabIndex = 11
Top = 3360
Width = 540
End
Begin VB.Label Label10
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "职业:"
Height = 180
Left = 3000
TabIndex = 10
Top = 3360
Width = 540
End
Begin VB.Label Label9
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "手机:"
Height = 180
Left = 600
TabIndex = 9
Top = 2760
Width = 540
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "通信地址:"
Height = 180
Left = 240
TabIndex = 8
Top = 2160
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "电话:"
Height = 180
Left = 3000
TabIndex = 7
Top = 2760
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "车牌号:"
Height = 180
Left = 2880
TabIndex = 6
Top = 1560
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "性别:"
Height = 180
Left = 600
TabIndex = 5
Top = 1560
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "电子邮件:"
Height = 180
Left = 2880
TabIndex = 4
Top = 960
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "姓名:"
Height = 180
Left = 600
TabIndex = 3
Top = 960
Width = 540
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "出生日期:"
Height = 180
Left = 2880
TabIndex = 2
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0FFFF&
Caption = "身份证号:"
Height = 180
Left = 240
TabIndex = 1
Top = 360
Width = 900
End
End
End
Attribute VB_Name = "Frmkehulogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_kehu As New ADODB.Recordset
Dim gridclick As Boolean
Dim select_row As String '记录选择的楼盘
Dim getrow As Long
Private Sub cmdadd_Click()
On Error GoTo adderror
If cmdadd.Caption = "保存" Then
cmdadd.Caption = "增加"
If Trim(txtID.Text) = "" Then
MsgBox "身份证号不能为空!", vbOKOnly + vbExclamation, "出错啦!"
txtID.SetFocus
Exit Sub
End If
If Trim(txtname.Text) = "" Then
MsgBox "姓名不能为空!", vbOKOnly + vbExclamation, "出错啦!"
txtname.SetFocus
Exit Sub
End If
If Trim(Combo1.Text) = "" Then
MsgBox "请选择性别!", vbOKOnly + vbExclamation, "出错啦!"
Combo1.SetFocus
Exit Sub
End If
rs_kehu.MoveFirst
Dim i As Integer
For i = 0 To rs_kehu.RecordCount - 1
If rs_kehu.Fields(0) = txtID.Text Then
MsgBox "身份证号重复!", vbOKOnly + vbExclamation, "出错啦!"
txtID.SetFocus
Exit Sub
End If
rs_kehu.MoveNext
Next i
rs_kehu.MoveLast
rs_kehu.AddNew
rs_kehu.Fields(0) = txtID.Text
rs_kehu.Fields(1) = txtname.Text
rs_kehu.Fields(2) = Combo1.Text
If Trim(txttel.Text) = "" Then '电话信息
rs_kehu.Fields(3) = Null
Else
rs_kehu.Fields(3) = txttel.Text
End If
If Trim(txtcell.Text) = "" Then '手机信息
rs_kehu.Fields(4) = Null
Else
rs_kehu.Fields(4) = txtcell.Text
End If
If Trim(txtduty.Text) = "" Then '职业信息
rs_kehu.Fields(5) = Null
Else
rs_kehu.Fields(5) = txtduty.Text
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -