⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_czrk_xxedit.frm

📁 人口信息管理系统 人口信息管理 查询 修改 删除
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      End
      Begin VB.TextBox Text10 
         DataField       =   "月总收入"
         DataSource      =   "Adodc1"
         Height          =   300
         Left            =   5880
         TabIndex        =   4
         Text            =   "Text10"
         Top             =   840
         Width           =   1215
      End
      Begin VB.ComboBox Combo2 
         DataField       =   "经济状况"
         DataSource      =   "Adodc1"
         Height          =   300
         ItemData        =   "frm_CZRK_XXEDIT.frx":0521
         Left            =   7920
         List            =   "frm_CZRK_XXEDIT.frx":0534
         TabIndex        =   3
         Text            =   "温饱"
         Top             =   840
         Width           =   1215
      End
      Begin VB.ComboBox Combo3 
         DataField       =   "住所类型"
         DataSource      =   "Adodc1"
         Height          =   300
         ItemData        =   "frm_CZRK_XXEDIT.frx":0556
         Left            =   10200
         List            =   "frm_CZRK_XXEDIT.frx":0569
         TabIndex        =   2
         Text            =   "自有"
         Top             =   840
         Width           =   1455
      End
      Begin VB.TextBox Text11 
         DataField       =   "家庭备注"
         DataSource      =   "Adodc1"
         Height          =   735
         Left            =   960
         TabIndex        =   1
         Text            =   "Text11"
         Top             =   1200
         Width           =   10695
      End
      Begin VB.Label Label1 
         Caption         =   "户口类别"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   2640
         TabIndex        =   28
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "户口簿号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   120
         TabIndex        =   27
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "楼号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   5280
         TabIndex        =   26
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "户号"
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   7320
         TabIndex        =   25
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "户主姓名"
         Height          =   375
         Left            =   9240
         TabIndex        =   24
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "联系电话"
         Height          =   255
         Left            =   120
         TabIndex        =   23
         Top             =   600
         Width           =   975
      End
      Begin VB.Label Label7 
         Caption         =   "家庭地址"
         Height          =   255
         Left            =   2640
         TabIndex        =   22
         Top             =   600
         Width           =   735
      End
      Begin VB.Label Label8 
         Caption         =   "总人数"
         Height          =   375
         Left            =   3480
         TabIndex        =   21
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label9 
         Caption         =   "男 子 数"
         Height          =   255
         Left            =   120
         TabIndex        =   20
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label10 
         Caption         =   "女子数"
         Height          =   255
         Left            =   1920
         TabIndex        =   19
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label11 
         Caption         =   "月总收入"
         Height          =   255
         Left            =   5160
         TabIndex        =   18
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label12 
         Caption         =   "经济状况"
         Height          =   255
         Left            =   7200
         TabIndex        =   17
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label13 
         Caption         =   "住所类型"
         Height          =   255
         Left            =   9240
         TabIndex        =   16
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label14 
         Caption         =   "备    注"
         Height          =   375
         Left            =   120
         TabIndex        =   15
         Top             =   1320
         Width           =   735
      End
   End
   Begin VB.TextBox txt_temp1 
      Height          =   375
      Left            =   1320
      TabIndex        =   123
      Text            =   "Text18"
      Top             =   7440
      Width           =   1695
   End
   Begin MSComCtl2.DTPicker DTPicker7 
      Height          =   375
      Left            =   1080
      TabIndex        =   124
      Top             =   7320
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   661
      _Version        =   393216
      Format          =   19791873
      CurrentDate     =   38156
   End
End
Attribute VB_Name = "frm_CZRK_XXEDIT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i

Private Sub Check1_Click()
If Check1.Value = 1 Then
DTPicker5.Enabled = True
Text35.Enabled = True
Else
DTPicker5.Enabled = False
Text35.Enabled = False
End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
DTPicker6.Enabled = True
Text36.Enabled = True
Else
DTPicker6.Enabled = False
Text36.Enabled = False
End If
End Sub

Private Sub Cmd_cancel_Click()
Unload Me
End Sub
Private Sub Cmd_update_Click()
 Call main
frm_CZRK_HKB.Adodc1.RecordSource = "select * from Table_HKB order by 户口簿号"
frm_CZRK_HKB.Adodc1.Refresh
If Combo16.Text = "未迁移" And Check1.Value = 1 And Check2.Value = 0 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Text18 + "',死亡日期= '" + Str(DTPicker5) + "',死亡原因='" + Text35 + "',已亡故='" + Str(Trim(Check1)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
ElseIf Combo16.Text = "未迁移" And Check2.Value = 1 And Check1.Value = 0 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Text18 + "',注销日期= '" + Str(DTPicker6) + "',注销原因='" + Text36 + "',户口已注销='" + Str(Trim(Check2)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
ElseIf Combo16.Text = "未迁移" And Check1.Value = 1 And Check2.Value = 1 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Text18 + "',死亡日期= '" + Str(DTPicker5) + "', 注销日期= '" + Str(DTPicker6) + "',死亡原因='" + Text35 + "',注销原因='" + Text36 + "',已亡故='" + Str(Trim(Check1)) + "',户口已注销='" + Str(Trim(Check2)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
ElseIf Check1.Value = 1 And Check2.Value = 0 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Str(DTPicker4) + "',死亡日期= '" + Str(DTPicker5) + "',死亡原因='" + Text35 + "',已亡故='" + Str(Trim(Check1)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
ElseIf Check2.Value = 1 And Check1.Value = 0 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Str(DTPicker4) + "',注销日期= '" + Str(DTPicker6) + "',注销原因='" + Text36 + "',户口已注销='" + Str(Trim(Check2)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
ElseIf Check1.Value = 1 And Check2.Value = 1 Then
Adodc1.Recordset.UpdateBatch
Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Str(DTPicker4) + "',死亡日期= '" + Str(DTPicker5) + "', 注销日期= '" + Str(DTPicker6) + "',死亡原因='" + Text35 + "',注销原因='" + Text36 + "',已亡故='" + Str(Trim(Check1)) + "',户口已注销='" + Str(Trim(Check2)) + "' where 人口编号='" + Text13.Text + "'")
MsgBox "数据保存成功", 32, "提示"
Else
'ElseIf Combo16.Text = "未迁移" Then
'Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Text18 + "' where 人口编号='" + Text13.Text + "'")
Adodc1.Recordset.UpdateBatch
MsgBox "数据保存成功", 32, "提示"
'Else
'Adodc1.Recordset.UpdateBatch
'Set adoRs = adoCon.Execute("UPDATE Table_HKB SET 迁出日期= '" + Str(DTPicker4) + "' where 人口编号='" + Text13.Text + "'")
'MsgBox "数据保存成功", 32, "提示"
End If
adoCon.Close
Unload Me



End Sub

Private Sub Combo1_LostFocus()
Combo4.Text = Combo1.Text
End Sub

Private Sub Form_Activate()
Adodc1.RecordSource = "select * from Table_HKB where 人口编号='" + Text13.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If Adodc1.Recordset.Fields("迁出日期") = "0000-00-00" Then
Adodc1.Refresh
Else
'DTPicker4.Value = Adodc1.Recordset.Fields("死亡日期")
End If
If Adodc1.Recordset.Fields("迁出日期") = "0000-00-00" Then
Adodc1.Refresh
Else
'DTPicker5.Value = Adodc1.Recordset.Fields("死亡日期")
End If
If Adodc1.Recordset.Fields("注销日期") = "0000-00-00" Then
Adodc1.Refresh
Else
DTPicker6.Value = Adodc1.Recordset.Fields("注销日期")
End If

Else
End If
End Sub

Private Sub Text1_LostFocus()
Text14.Text = Text1.Text
End Sub

Private Sub Text13_GotFocus()
Text13.Text = Text2.Text + "001"
End Sub

Private Sub Text3_LostFocus()
Text12.Text = Text3.Text
End Sub

Private Sub Text4_LostFocus()
Text15.Text = Text4.Text
End Sub

Private Sub Text8_LostFocus()
Text9.Text = Val(Text7.Text) + Val(Text8.Text)
End Sub

Private Sub txt_sfzhm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
  Dim StrInput, Temp As String
  Dim i, j, Length As Integer
  i = 1
  j = 7
  StrInput = txt_sfzhm.Text
  Length = Len(StrInput)
         If txt_sfzhm.Text = "" Then
         MsgBox "输入不能为空", 48, "提示"
         txt_sfzhm.SetFocus
         Else
              If Length = 18 Then
              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
                        txt_sfzhm.Text = ""
                        txt_sfzhm.SetFocus
                    Else
                    Text19.SetFocus
                    End If
                    i = i + 1
               Loop
               Temp = Mid$(StrInput, j, 4)
               txt_temp1.Text = Temp
               j = j + 4
               Temp = Mid$(StrInput, j, 2)
               If Temp > 12 Or Temp < 0 Then
               MsgBox "您输入的身份证号非法"
               txt_sfzhm.Text = ""
               txt_sfzhm.SetFocus
               Else
               txt_temp1.Text = txt_temp1.Text + "-" + Temp
               j = j + 2
               Temp = Mid$(StrInput, j, 2)
               txt_temp1.Text = txt_temp1.Text + "-" + Temp
               DTPicker2.Value = txt_temp1.Text
               Text20.Text = DateDiff("yyyy", DTPicker2.Value, DTPicker7.Value)
               End If
               ElseIf Length < 18 Or Length > 18 Then
               MsgBox "您输入的身份证号的位数非法!", 48, "提示"
               txt_sfzhm.Text = ""
               txt_sfzhm.SetFocus
               Else
               End If
          End If
Else
End If

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -