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

📄 frm_infoinputx.txt

📁 一个vb开发的人事信息管理软件,提供基本的人事信息管理
💻 TXT
📖 第 1 页 / 共 2 页
字号:
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "电    话"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   9
         Left            =   4050
         TabIndex        =   30
         Top             =   2010
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "邮政编码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   8
         Left            =   4050
         TabIndex        =   29
         Top             =   1590
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "家庭住址"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   7
         Left            =   4050
         TabIndex        =   28
         Top             =   1170
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "专    业"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   6
         Left            =   4050
         TabIndex        =   27
         Top             =   780
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "学    历"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   5
         Left            =   4050
         TabIndex        =   26
         Top             =   450
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "年    龄"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   4
         Left            =   450
         TabIndex        =   25
         Top             =   2010
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "出生日期"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   3
         Left            =   450
         TabIndex        =   24
         Top             =   1590
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "性    别"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   2
         Left            =   450
         TabIndex        =   23
         Top             =   1200
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "职工姓名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   1
         Left            =   450
         TabIndex        =   22
         Top             =   810
         Width           =   885
      End
      Begin VB.Label Label1 
         Caption         =   "职工编号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   450
         TabIndex        =   20
         Top             =   420
         Width           =   885
      End
   End
End
Attribute VB_Name = "Frm_InfoInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    
End Sub

Private Sub BornDate_KeyPress(KeyAscii As Integer)
    TabToEnter (KeyAscii)
End Sub

Private Sub BSalaryDate_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Cmd_Cancel_Click()
    Unload Me
End Sub

Private Sub Cmd_Save_Click()
    Dim m_Rs As New ADODB.Recordset
    Dim i As Integer
    Dim strSql As String
    '''''''检查输入的正确性''''''''''''''''''''''''
    If Text1.Text = "" Then
       MsgBox "职工编号不能为空..."
       Exit Sub
    End If
    strSql = "SELECT  *  FROM  StuffInfo WHERE  SID='" & Trim(Text1.Text) & "'"
    If isRecordExist(strSql, "Person.mdb") Then
       MsgBox "此职工编号的记录已经存在..."
       Exit Sub
    End If
    If Text2.Text = "" Then
       MsgBox "职工姓名不能为空...", vbOKOnly + vbExclamation, "警告!"
       Exit Sub
       ''Me.Text2.SetFocus
    End If
    If Combo1.Text = "" Then
       MsgBox "职工出生日期不能为空...", vbOKOnly + vbExclamation, "警告!"
      Exit Sub
    End If
    If Not IsDate(BornDate.Text) Then
       MsgBox "职工出生日期格式错误,输入正确的日期格式...", vbOKOnly + vbExclamation, "警告!"
       Exit Sub
    End If
    If Combo4.Text = "" Then
       MsgBox "请输入部门名称...", vbOKOnly + vbExclamation, "警告!"
       Exit Sub
    End If
    ''''''检查输入的正确性结束'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''进行存盘操作''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    If MsgBox("确定是否存盘?", vbYesNo + vbQuestion, "存盘?") = vbYes Then
       strSql = "INSERT INTO  StuffInfo(SID,SName,SGender,SPlace,SAge,SBirthday,SDegree,SSpecial,SAddress,SCode,STel,SEmail"
       strSql = strSql & ",SWorkTime,SInTime,SDept,SPayTime,SPosition,SRemark) VALUES('" & Trim(Text1.Text) & "','" & Trim(Text2.Text) & "','" & Trim(Combo1.Text) & "','" & Trim(Text9.Text) & "'," & Val(Text3.Text) & ",'"
       strSql = strSql & Trim(BornDate.Text) & "','" & Trim(Combo2.Text) & "','" & Trim(Text4.Text) & "','" & Trim(Text5.Text) & "','"
       strSql = strSql & Trim(Text6.Text) & "','" & Trim(Text7.Text) & "','" & Trim(Text8.Text) & "','" & Trim(WorkDate.Text) & "','" & Trim(InDate.Text) & "','"
       strSql = strSql & Trim(Combo4.Text) & "','" & Trim(BSalaryDate.Text) & "','" & Trim(Combo3.Text) & "','" & Trim(Text10.Text) & "')"
       MsgBox strSql
       
      
    End If
End Sub

Private Sub Combo1_KeyPress(KeyAscii As Integer)
    TabToEnter (KeyAscii)
End Sub

Private Sub Combo2_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Combo4_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Form_Load()
    ''''添加信息'''''''''
    Combo1.AddItem "男"
    Combo1.AddItem "女"
    ''''''
   Combo2.AddItem "小学"
   Combo2.AddItem "初中"
   Combo2.AddItem "高中"
   Combo2.AddItem "技校"
   Combo2.AddItem "中专"
   Combo2.AddItem "专科"
   Combo2.AddItem "大专"
   Combo2.AddItem "本科"
   Combo2.AddItem "硕士"
   Combo2.AddItem "研究生"
   Combo2.AddItem "博士"
   '''''自动计算职工的编号''''''''''''''''''''
   Dim m_Rs As New ADODB.Recordset
   Dim strSql As String
   Dim i As Integer
   Dim i_RecordCount As Integer
   strSql = "SELECT COUNT(*) FROM  StuffInfo"
   i_RecordCount = getRstCount(strSql, "Person.mdb") + 1 '''''得到记录个数,然后加1
   Text1.Text = "P" + Trim(Str(1000000 + i_RecordCount))
   ''''''''''''''''
   WorkDate.Text = Format(Now, "yyyy年mm月dd日")
   BSalaryDate.Text = Format(Now, "yyyy年mm月dd日")
   InDate.Text = Format(Now, "yyyy年mm月dd日")
End Sub

Private Sub InDate_KeyPress(KeyAscii As Integer)
    TabToEnter (KeyAscii)
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
    TabToEnter (KeyAscii)
End Sub

Private Sub Text10_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text3_GotFocus()
   ''''''根据出生日期自动计算年龄'''''''''''''
   Dim iAge As Integer
   If BornDate.Text = "" Then
      MsgBox "出生日期输入错误...", vbOKOnly + vbExclamation, "警告!"
      Combo1.SetFocus
   End If
   iAge = Val(Mid(Trim(Format(Now, "yyyy-mm-dd")), 1, 4)) - Val(Mid(Trim(Format(BornDate.Text, "yyyy-mm-dd")), 1, 4)) + 1
   Text3.Text = Trim(Str(iAge))
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub Text9_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

Private Sub WorkDate_KeyPress(KeyAscii As Integer)
   TabToEnter (KeyAscii)
End Sub

⌨️ 快捷键说明

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