📄 femnew.frm
字号:
VERSION 5.00
Begin VB.Form frmNew
Caption = "会员入会"
ClientHeight = 5550
ClientLeft = 60
ClientTop = 450
ClientWidth = 5220
LinkTopic = "Form1"
ScaleHeight = 5550
ScaleWidth = 5220
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdBack
Caption = "返 回"
Height = 495
Left = 3600
TabIndex = 10
Top = 4320
Width = 1335
End
Begin VB.TextBox txtTel
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1680
TabIndex = 7
Top = 2400
Width = 2055
End
Begin VB.TextBox txtAddress
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1680
TabIndex = 6
Top = 3360
Width = 2055
End
Begin VB.TextBox txtName
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1680
TabIndex = 3
Top = 480
Width = 2055
End
Begin VB.TextBox txtPersonID
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 420
Left = 1680
TabIndex = 2
Top = 1440
Width = 2055
End
Begin VB.CommandButton cmdRewrite
Caption = "重 填"
Height = 495
Left = 1920
TabIndex = 1
Top = 4320
Width = 1335
End
Begin VB.CommandButton cmdCheck
Caption = "提 交"
Height = 495
Left = 240
TabIndex = 0
Top = 4320
Width = 1335
End
Begin VB.Label Label4
Caption = "地址:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 9
Top = 3360
Width = 735
End
Begin VB.Label Label3
Caption = "电话号码:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 8
Top = 2400
Width = 1215
End
Begin VB.Label Label1
Caption = "姓名:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 5
Top = 600
Width = 735
End
Begin VB.Label Label2
Caption = "身份证号:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 4
Top = 1560
Width = 1335
End
End
Attribute VB_Name = "frmNew"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBack_Click()
Unload Me
frmAdmin.Show
End Sub
Private Sub cmdCheck_Click()
If txtName Like "" Then
MsgBox "对不起,姓名不能为空!", vbOKOnly + vbExclamation, "错误"
txtName.SetFocus
Exit Sub
End If
If txtPersonID Like "" Then
MsgBox "对不起,身份证号码不能为空!", vbOKOnly + vbExclamation, "错误"
txtPersonID.SetFocus
Exit Sub
End If
Dim length As Integer
length = Len(txtPersonID.Text)
If length <> 18 Then
MsgBox "对不起,身份证号码错误!", vbOKOnly + vbExclamation, "错误"
txtPersonID.Text = ""
txtPersonID.SetFocus
Exit Sub
End If
For i = 1 To 18
If Mid(txtPersonID.Text, i, 1) < "0" Or Mid(txtPersonID.Text, i, 1) > "9" Then
MsgBox "对不起,身份证号码错误!", vbOKOnly + vbExclamation, "错误"
txtPersonID.Text = ""
txtPersonID.SetFocus
Exit Sub
End If
Next i
Set db = OpenDatabase("Haiyu.mdb")
Set rs = db.OpenRecordset("SELECT * FROM Customer")
rs.MoveLast
Dim temp As Double
temp = rs!ID + 1
With rs
.AddNew
!ID = temp
!姓名 = txtName.Text
!身份证号 = txtPersonID.Text
!密码 = "111111"
!电话 = txtTel.Text
!地址 = txtAddress.Text
.Update
End With
MsgBox "ID是" & temp & "密码是111111", vbOKOnly, "成功"
Unload Me
frmAdmin.Show
End Sub
Private Sub cmdRewrite_Click()
txtName.Text = ""
txtPersonID.Text = ""
txtTel.Text = ""
txtAddress.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -