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

📄 frm_zzrk_edit.frm

📁 人口信息管理系统 人口信息管理 查询 修改 删除
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Caption         =   "姓名"
         ForeColor       =   &H00C000C0&
         Height          =   255
         Left            =   240
         TabIndex        =   11
         Top             =   840
         Width           =   1095
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "截止日期"
         ForeColor       =   &H00C000C0&
         Height          =   255
         Left            =   6720
         TabIndex        =   9
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "签发日期"
         ForeColor       =   &H00C000C0&
         Height          =   255
         Left            =   3240
         TabIndex        =   7
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "暂住证号"
         ForeColor       =   &H00C000C0&
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   480
         Width           =   855
      End
   End
End
Attribute VB_Name = "frm_ZZRK_EDIT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_exit_Click()
Unload Me
End Sub

Private Sub Cmd_save_Click()
Call main
Set adoRs = adoCon.Execute("insert into Table_ZZRKB values(" & Text1 & ",'" & DTPicker1 & "','" & DTPicker2 & "','" & Text2 & "','" & Text3 & "','" & Combo1(1) & "','" & txt_sfzhm.Text & "','" & DTPicker3 & "','" & Combo2 & "','" & Text5 & "','" & Text6 & "','" & Combo3 & "','" & Combo10(1) & "','" & Combo5(0) & "','" & Combo6 & "','" & Combo4(1) & "','" & Combo8 & "','" & Text7 & "','" & Combo12(2) & _
"','" & Combo13(2) & "','" & Text9 & "','" & DTPicker4 & "','" & Text10 & "','" & Text11 & "','" & Combo14(0) & "','" & Text12 & "','" & Text13 & "','" & Text14 & "','" & Text15 & "','" & Combo15(1) & "','" & Text16 & "','" & Check1 & "','" & DTPicker5 & "','" & Text17 & "','" & Text18 & "','" & Text19 & "')")
MsgBox "数据保存成功", 32, "人口信息管理系统"
frm_ZZRK_ZB.Adodc1.Refresh
Unload Me
adoCon.Close
End Sub

Private Sub Combo1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
txt_sfzhm.SetFocus
Else
End If
End Sub

Private Sub Combo10_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo5(0).SetFocus
Else
End If
End Sub

Private Sub Combo12_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo13(2).SetFocus
Else
End If
End Sub

Private Sub Combo13_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text9.SetFocus
Else
End If
End Sub

Private Sub Combo14_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text13.SetFocus
Else
End If
End Sub

Private Sub Combo15_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text16.SetFocus
Else
End If
End Sub

Private Sub Combo2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text6.SetFocus
Else
End If
End Sub

Private Sub Combo3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo10(1).SetFocus
Else
End If
End Sub

Private Sub Combo4_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo8.SetFocus
Else
End If
End Sub

Private Sub Combo5_KeyDown(Index As Integer, 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
Combo4(1).SetFocus
Else
End If
End Sub

Private Sub Combo8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text7.SetFocus
Else
End If
End Sub

Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker2.SetFocus
Else
End If
End Sub

Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub

Private Sub DTPicker4_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text10.SetFocus
Else
End If
End Sub

Private Sub DTPicker5_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text17.SetFocus
Else
End If
End Sub

Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
DTPicker1.Value = Date
DTPicker2.Value = Date
DTPicker3.Value = Date
DTPicker4.Value = Date
DTPicker5.Value = Date
DTPicker6.Value = Format(Now, "yyyy-mm-dd")
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker1.SetFocus
Else
End If
End Sub

Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text11.SetFocus
Else
End If
End Sub

Private Sub Text11_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo14(0).SetFocus
Else
End If
End Sub

Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text14.SetFocus
Else
End If
End Sub

Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text12.SetFocus
Else
End If
End Sub

Private Sub Text14_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text15.SetFocus
Else
End If
End Sub

Private Sub Text15_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo15(1).SetFocus
Else
End If
End Sub

Private Sub Text16_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text19.SetFocus
Else
End If
End Sub

Private Sub Text17_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text18.SetFocus
Else
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text3.SetFocus
Else
End If
End Sub

Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo1(1).SetFocus
Else
End If
End Sub

Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo3.SetFocus
Else
End If
End Sub

Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Combo12(2).SetFocus
Else
End If
End Sub

Private Sub Text9_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DTPicker4.SetFocus
Else
End If
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
                    Combo2.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
               DTPicker3.Value = txt_temp1.Text
               Text5.Text = DateDiff("yyyy", DTPicker3.Value, DTPicker6.Value)
               End If
               ElseIf Length = 15 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
                    Combo2.SetFocus
                    End If
                    i = i + 1
               Loop
               Text4.Text = Mid$(StrInput, j, 2)
               Temp = "19" + Text4.Text
               txt_temp1.Text = Temp
               j = j + 2
               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
               DTPicker3.Value = txt_temp1.Text
               Text5.Text = DateDiff("yyyy", DTPicker3.Value, DTPicker6.Value)
               End If
               Else
               MsgBox "您输入的身份证号的位数非法!", 48, "提示"
               txt_sfzhm.Text = ""
               txt_sfzhm.SetFocus
               End If
          End If
          
Else
End If


'If KeyCode = 13 Then
'Combo2.SetFocus
'Else
'End If

End Sub

⌨️ 快捷键说明

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