📄 frm_sqjz_yfry.frm
字号:
Format = 48627713
CurrentDate = 38157
End
Begin VB.Label Label1
Caption = "姓 名"
Height = 255
Left = 240
TabIndex = 32
Top = 360
Width = 855
End
Begin VB.Label Label2
Caption = "身份证号"
Height = 255
Left = 2880
TabIndex = 31
Top = 360
Width = 855
End
Begin VB.Label Label3
Caption = "性 别"
Height = 255
Left = 5280
TabIndex = 30
Top = 360
Width = 735
End
Begin VB.Label Label4
Caption = "出生日期"
Height = 255
Left = 240
TabIndex = 29
Top = 840
Width = 855
End
Begin VB.Label Label5
Caption = "文化程度"
Height = 255
Left = 2880
TabIndex = 28
Top = 840
Width = 855
End
Begin VB.Label Label6
Caption = "婚姻状况"
Height = 375
Left = 5280
TabIndex = 27
Top = 840
Width = 855
End
Begin VB.Label Label7
Caption = "楼 号"
Height = 375
Left = 240
TabIndex = 26
Top = 1320
Width = 975
End
Begin VB.Label Label8
Caption = "户 号"
Height = 375
Left = 2880
TabIndex = 25
Top = 1320
Width = 855
End
Begin VB.Label Label9
Caption = "家庭人数"
Height = 375
Left = 5280
TabIndex = 24
Top = 1320
Width = 855
End
Begin VB.Label Label10
Caption = "经济状况"
Height = 255
Left = 240
TabIndex = 23
Top = 1800
Width = 735
End
Begin VB.Label Label11
Caption = "住所类型"
Height = 255
Left = 2880
TabIndex = 22
Top = 1800
Width = 735
End
Begin VB.Label Label12
Caption = "月 收 入"
Height = 255
Left = 5280
TabIndex = 21
Top = 1800
Width = 735
End
Begin VB.Label Label13
Caption = "家庭电话"
Height = 255
Left = 240
TabIndex = 20
Top = 2280
Width = 855
End
Begin VB.Label Label14
Caption = "住 址"
Height = 255
Left = 2880
TabIndex = 19
Top = 2280
Width = 735
End
End
Begin VB.CommandButton Cmd_cancel
Caption = "取消"
Height = 375
Left = 6120
TabIndex = 2
Top = 5400
Width = 1095
End
Begin VB.CommandButton Cmd_add
Caption = "增加"
Height = 375
Left = 4920
TabIndex = 1
Top = 5400
Width = 1095
End
Begin VB.CommandButton Cmd_select
Caption = "选择居民"
Height = 375
Left = 840
TabIndex = 0
Top = 5400
Width = 1455
End
End
Attribute VB_Name = "frm_SQJZ_YFRY"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()
Call main
frm_CZRK_HKB.Adodc1.RecordSource = "select * from Table_HKB where 姓名='" + Text1.Text + "'"
frm_CZRK_HKB.Adodc1.Refresh
If frm_CZRK_HKB.Adodc1.Recordset.RecordCount > 0 Then
frm_SQJZ_ZB.Adodc1.RecordSource = "select * from Table_SQJZ_YFRY where 优抚证号='" + Text12.Text + "'"
frm_SQJZ_ZB.Adodc1.Refresh
If frm_SQJZ_ZB.Adodc1.Recordset.RecordCount > 0 Then
MsgBox "此人的信息已经存在,输入不能继续", 48, "提示"
Else
Text15.Text = frm_CZRK_HKB.Adodc1.Recordset.Fields("人口编号")
Set adoRs = adoCon.Execute("insert into Table_SQJZ_YFRY values(" & Text12 & ",'" & Text15 & "','" & Text1 & "','" & Text2 & "','" & Combo1 & "','" & DTPicker1 & "','" & Text3 & "','" & Combo2 & "','" & Combo3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Combo4 & "','" & Combo5 & "','" & Combo6 & "','" & Combo7 & "','" & Text13 & "','" & Combo8 & "','" & Text14 & "')")
MsgBox "数据保存成功!", 32, "人口信息管理系统"
Unload Me
frm_SQJZ_ZB.Adodc1.Refresh
End If
Else
MsgBox "数据库中没有此人的信息", 48, "提示"
End If
adoCon.Close
End Sub
Private Sub Cmd_cancel_Click()
Unload Me
End Sub
Private Sub Cmd_select_Click()
frm_SQJZ_ryxz.Show
End Sub
Private Sub Combo4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo5.SetFocus
Else
End If
End Sub
Private Sub Combo5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo6.SetFocus
Else
End If
End Sub
Private Sub Combo6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo7.SetFocus
Else
End If
End Sub
Private Sub Combo7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text13.SetFocus
Else
End If
End Sub
Private Sub Combo8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text14.SetFocus
Else
End If
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim i, Length As Integer
i = 1
StrInput = Text12.Text
Length = Len(StrInput)
If Text12.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text12.SetFocus
Else
Do While (i <= Length)
Temp = Mid$(StrInput, i, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If i = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text12.Text = ""
Text12.SetFocus
Else
End If
i = i + 1
Loop
If Text12.Text = "" Then
Text12.SetFocus
Else
Combo4.SetFocus
End If
End If
Else
End If
End Sub
Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo8.SetFocus
Else
End If
End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim i, Length As Integer
i = 1
StrInput = Text6.Text
Length = Len(StrInput)
If Text6.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text6.SetFocus
Else
Do While (i <= Length)
Temp = Mid$(StrInput, i, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If i = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text6.Text = ""
Text6.SetFocus
Else
End If
i = i + 1
Loop
If Text6.Text = "" Then
Text6.SetFocus
Else
Text7.SetFocus
End If
End If
Else
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -