📄 frmxz1.frm
字号:
VERSION 5.00
Begin VB.Form frmxz1
ClientHeight = 8175
ClientLeft = 60
ClientTop = 60
ClientWidth = 9165
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 8175
ScaleWidth = 9165
WindowState = 2 'Maximized
Begin VB.OptionButton Option2
Caption = "迁入一个新人口到所属户"
Height = 255
Left = 3480
TabIndex = 16
Top = 3960
Width = 2295
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 4920
TabIndex = 12
Top = 4560
Width = 855
End
Begin VB.Frame Frame2
Caption = "查询户号"
Height = 2055
Left = 2400
TabIndex = 6
Top = 5520
Width = 4455
Begin VB.CommandButton Command2
Caption = "查询"
Height = 375
Left = 2880
TabIndex = 9
Top = 840
Width = 855
End
Begin VB.TextBox Text3
Height = 270
Left = 480
MaxLength = 22
TabIndex = 8
Top = 840
Width = 2055
End
Begin VB.Label Label7
BorderStyle = 1 'Fixed Single
Height = 255
Left = 1560
TabIndex = 11
Top = 1440
Width = 2175
End
Begin VB.Label Label4
Caption = "户号为:"
Height = 255
Left = 480
TabIndex = 10
Top = 1440
Width = 975
End
Begin VB.Label Label3
Caption = "可以使用所属户户主身份证号查询户号:"
Height = 255
Left = 360
TabIndex = 7
Top = 360
Width = 3495
End
End
Begin VB.Frame Frame1
Caption = "人口入户"
Height = 3495
Left = 2400
TabIndex = 0
Top = 1680
Width = 4455
Begin VB.Frame Frame3
Height = 975
Left = 840
TabIndex = 14
Top = 1680
Width = 2775
Begin VB.OptionButton Option1
Caption = "添加一个新人口到所属户"
Height = 255
Left = 240
TabIndex = 15
Top = 240
Width = 2415
End
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1080
TabIndex = 5
Top = 2880
Width = 855
End
Begin VB.TextBox Text2
Height = 270
Left = 2160
MaxLength = 10
TabIndex = 4
Top = 840
Width = 1215
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
MaxLength = 3
TabIndex = 2
Top = 840
Width = 615
End
Begin VB.Label Label5
Caption = "请选择进行何种操作:"
Height = 255
Left = 480
TabIndex = 13
Top = 1320
Width = 2055
End
Begin VB.Label Label2
Caption = "-"
Height = 255
Left = 1920
TabIndex = 3
Top = 840
Width = 135
End
Begin VB.Label Label1
Caption = "请输入此人所属户的户号:"
Height = 255
Left = 480
TabIndex = 1
Top = 360
Width = 3375
End
End
Begin VB.Image Image1
Height = 495
Left = 6720
Picture = "frmxz1.frx":0000
Top = 240
Width = 510
End
Begin VB.Label Label8
Caption = "·输入正确所属户号才能进入添加或迁入人口页面"
ForeColor = &H00000080&
Height = 255
Left = 2520
TabIndex = 18
Top = 1200
Width = 4095
End
Begin VB.Shape Shape1
Height = 615
Left = 1560
Top = 240
Width = 4335
End
Begin VB.Label Label6
Caption = "添加或迁入人口验证"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1800
TabIndex = 17
Top = 360
Width = 3735
End
End
Attribute VB_Name = "frmxz1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
Dim local_db As String
Private Sub Command1_Click()
Dim huhao As String
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "所属户的户号未输入或格式不正确", , "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
If Option1.Value = False And Option2.Value = False Then
MsgBox "请选择要进行何种操作", , "警告"
End If
End If
If Text1.Text <> "" And Text2.Text <> "" And (Option1.Value = True Or Option2.Value = True) Then
huhao = Trim(Text1.Text) & "-" & Trim(Text2.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 户口表.户号=" + "'" + huhao + "'"
ret.Open local_db, cnn
If Not (ret.BOF And ret.EOF) Then
If Option1.Value = True Then
flag = 1
temphuhao1 = Trim(Text1.Text)
temphuhao2 = Trim(Text2.Text)
Unload frmxz1
frmpeople.Show
Else
flag = 2
temphuhao1 = Trim(Text1.Text)
temphuhao2 = Trim(Text2.Text)
Unload frmxz1
frmpeople.Show
End If
Else
MsgBox "对不起,没有此户,请重新输入", , "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
End If
End Sub
Private Sub Command2_Click()
Dim sf As String
Dim hz As String
Dim cnn As New ADODB.Connection
Dim ret As New ADODB.Recordset
hz = "户主"
Dim local_db As String
If Text3.Text = "" Then
MsgBox "请输入户主身份证号", , "警告"
Text3.SetFocus
Else
sf = Trim(Text3.Text)
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "\data\db.mdb" + ";Persist Security Info=False;"
local_db = "select 户号 from 人口表" + _
" where 人口表.身份证号=" + "'" + sf + "'" + "and 人口表.与户主关系=" + "'" + hz + "'"
ret.Open local_db, cnn
If ret.BOF And ret.EOF Then
MsgBox "无此身份证号,或不是户主身份证号", , "警告"
Text3.Text = ""
Text3.SetFocus
Else
Label7.Caption = ret("户号")
End If
End If
End Sub
Private Sub Command3_Click()
Unload frmxz1
'初始化主窗口
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -