📄 frmpeoplexg.frm
字号:
Left = 240
TabIndex = 22
Top = 1680
Width = 615
End
Begin VB.Label Label11
Caption = "民族:"
Height = 255
Left = 5760
TabIndex = 21
Top = 960
Width = 735
End
Begin VB.Label Label10
Caption = "性别:"
Height = 255
Left = 3360
TabIndex = 20
Top = 960
Width = 735
End
Begin VB.Label Label9
Caption = "身份证号:"
Height = 255
Left = 240
TabIndex = 19
Top = 960
Width = 975
End
Begin VB.Label Label7
Caption = "与户主关系:"
Height = 255
Left = 6240
TabIndex = 18
Top = 360
Width = 1095
End
Begin VB.Label Label5
Caption = "姓名:"
Height = 255
Left = 3360
TabIndex = 17
Top = 360
Width = 615
End
Begin VB.Label Label1
Caption = "所属户号:"
Height = 255
Left = 240
TabIndex = 16
Top = 360
Width = 975
End
Begin VB.Label Label2
BorderStyle = 1 'Fixed Single
Height = 255
Left = 1200
TabIndex = 15
Top = 360
Width = 1455
End
End
Begin VB.CommandButton Command2
Caption = "修改"
Height = 375
Left = 5760
TabIndex = 9
Top = 7440
Width = 855
End
Begin VB.CommandButton Command1
Caption = "关闭"
Height = 375
Left = 2400
TabIndex = 8
Top = 7440
Width = 855
End
Begin VB.Frame Frame5
Caption = "迁出信息"
Enabled = 0 'False
Height = 1215
Left = 120
TabIndex = 4
Top = 5880
Width = 9015
Begin VB.Label Label37
BorderStyle = 1 'Fixed Single
Height = 375
Left = 3840
TabIndex = 44
Top = 480
Width = 4935
End
Begin VB.Label Label25
Caption = "迁出到何地:"
Enabled = 0 'False
Height = 375
Left = 2520
TabIndex = 7
Top = 600
Width = 1095
End
Begin VB.Label Label26
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 6
Top = 600
Width = 975
End
Begin VB.Label Label27
Caption = "迁出日期:"
Enabled = 0 'False
Height = 375
Left = 240
TabIndex = 5
Top = 600
Width = 1095
End
End
Begin VB.Frame Frame4
Caption = "迁入信息"
Height = 1215
Left = 120
TabIndex = 0
Top = 3840
Width = 9015
Begin VB.Label Label32
BorderStyle = 1 'Fixed Single
Height = 375
Left = 3840
TabIndex = 43
Top = 480
Width = 4935
End
Begin VB.Label Label22
Caption = "自何地迁入:"
Height = 375
Left = 2520
TabIndex = 3
Top = 600
Width = 1095
End
Begin VB.Label Label23
Height = 375
Left = 1440
TabIndex = 2
Top = 600
Width = 975
End
Begin VB.Label Label24
Caption = "迁入日期:"
Height = 375
Left = 240
TabIndex = 1
Top = 600
Width = 1095
End
End
End
Attribute VB_Name = "frmpeoplexg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Unload frmpeoplexg
'初始化主窗口
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
GetStatus "<就绪>"
End Sub
Private Sub Command2_Click()
'声明变量
Dim thuhao As String
Dim tidcard As String
Dim tname As String
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
Dim local_db As String
thuhao = Label2.Caption
'检查各项是否为空
If Text9.Text = "" Then
MsgBox "姓名不能为空", , "警告"
Text9.SetFocus
Else '检查在同一户籍中是否存在同名人员
If Text9.Text = tempname Then
flag = 1
Else
tname = Trim(Text9.Text)
Set cnn = New ADODB.Connection
Set ret = New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
local_db = "select 姓名 from 人口表" + _
" where 人口表.户号=" + "'" + thuhao + "'" + " and 人口表.姓名=" + "'" + tname + "'"
ret.Open local_db, cnn
If Not (ret.BOF And ret.EOF) Then
MsgBox "此户中已有此人,不能修改为重名人员", , "警告"
Text9.SetFocus
ret.Close
cnn.Close
Else
flag = 1
End If
End If
If flag = 1 Then
If Text1.Text = "" Then
MsgBox "请输入身份证号", , "警告"
Text1.SetFocus
Else '检查身份证号是否重复
If Text1.Text = tempidcard Then
flag2 = 1
Else
tidcard = Trim(Text1.Text)
Set cnn = New ADODB.Connection
Set ret = New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
local_db = "select 身份证号 from 人口表" + _
" where 人口表.身份证号=" + "'" + tidcard + "'"
ret.Open local_db, cnn
If Not (ret.BOF And ret.EOF) Then
MsgBox "此身份证号已存在,不能修改为重复的身份证号", , "警告"
Text1.Text = ""
Text1.SetFocus
ret.Close
cnn.Close
Else
flag2 = 1
End If
End If
If flag2 = 1 Then
If Combo1.Text = "" Then
MsgBox "请选择文化程度", , "警告"
Else
If Combo1.Text <> "小学" And Combo1.Text <> "初中" And Combo1.Text <> "高中" And Combo1.Text <> "大专" And Combo1.Text <> "本科" And _
Combo1.Text <> "其他" Then
MsgBox "请从下拉列表中选择文化程度", , "警告"
Else
If Combo2.Text = "" Then
MsgBox "请选择婚姻状况", , "警告"
Else
If Combo2.Text <> "未婚" And Combo2.Text <> "已婚" Then
MsgBox "请从下拉列表中选择婚姻状况", , "警告"
End If
End If
End If
End If
End If
End If
End If
End If
If Text9.Text <> "" And Text1.Text <> "" And Combo1.Text <> "" And Combo2.Text <> "" Then
If Text9.Text <> tempname Or Text1.Text <> tempidcard Or Combo1.Text <> tempwenhua Or Combo2.Text <> temphunyin Or _
Text5.Text <> tempzhiye1 Or Text6.Text <> tempdanwei1 Then
If Combo1.Text = "小学" Or Combo1.Text = "初中" Or Combo1.Text = "高中" Or Combo1.Text = "大专" Or Combo1.Text = "本科" Or _
Combo1.Text = "其他" Then
If Combo2.Text = "未婚" Or Combo2.Text = "已婚" Then
Dim name1 As String
Dim idcard1 As String
Dim wenhua1 As String
Dim hunyin1 As String
Dim zhiye1 As String
Dim danwei1 As String
name1 = Trim(Text9.Text)
idcard1 = Trim(Text1.Text)
wenhua1 = Combo1.Text
hunyin1 = Combo2.Text
zhiye1 = Trim(Text5.Text)
danwei1 = Trim(Text6.Text)
Set cnn = New ADODB.Connection
Set ret = New ADODB.Recordset
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
local_db = "update 人口表" + _
" set 姓名=" + "'" + name1 + "'," + "身份证号=" + "'" + idcard1 + "'," + "文化程度=" + "'" + wenhua1 + "'," + "婚姻状况=" + "'" + hunyin1 + "'," + _
"职业=" + "'" + zhiye1 + "'," + "工作单位=" + "'" + danwei1 + "'" + _
" where 姓名=" + "'" + tempname + "'and " + "户号=" + "'" + thuhao + "'and " + "身份证号=" + "'" + tempidcard + "'"
cnn.Execute local_db
MsgBox "人口信息修改成功", , "提示"
Unload frmpeoplexg
'初始化主窗口
mainfrm.guanli.Enabled = True
mainfrm.chaxun.Enabled = True
mainfrm.tongji.Enabled = True
If userid = "admin" Then
mainfrm.xitong.Enabled = True
mainfrm.bdb.Enabled = True
Else
mainfrm.xitong.Enabled = False
mainfrm.bdb.Enabled = False
End If
mainfrm.Command1.Enabled = True
mainfrm.Command2.Enabled = True
mainfrm.Command3.Enabled = True
If userid = "admin" Then
mainfrm.Command4.Enabled = True
Else
mainfrm.Command4.Enabled = False
End If
End If
End If
End If
End If
End Sub
Private Sub Command3_Click()
frmpeoplexg.Label6.Visible = True
Text9.Text = tempname1
Label3.Caption = tempguanxi1
Text1.Text = tempidcard1
Label4.Caption = tempxingbie1
Label8.Caption = tempmingzu1
Label29.Caption = tempjiguan1
Label30.Caption = tempdate11
Label31.Caption = tempdate12
Label36.Caption = tempdate13
Label34.Caption = tempchushengdi1
Combo1.Text = tempwenhua1
Combo2.Text = temphunyin1
Text5.Text = tempzhiye1
Text6.Text = tempdanwei1
Label23.Caption = tempqrriqi1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -