form5.frm

来自「一个vb工资管理系统」· FRM 代码 · 共 653 行 · 第 1/2 页

FRM
653 行
字号
            Top             =   3720
            Width           =   2775
         End
         Begin VB.CommandButton Command5 
            Caption         =   "取  消  调  入"
            Height          =   495
            Left            =   120
            TabIndex        =   22
            Top             =   3120
            Width           =   2775
         End
         Begin VB.CommandButton Command4 
            Caption         =   "确  定  调  入"
            Height          =   495
            Left            =   120
            TabIndex        =   21
            Top             =   2520
            Width           =   2775
         End
         Begin VB.ComboBox Combo1 
            Height          =   300
            Left            =   240
            TabIndex        =   19
            Text            =   "请选择..."
            Top             =   960
            Width           =   2535
         End
         Begin VB.Label Label8 
            AutoSize        =   -1  'True
            Caption         =   "单位现有部门列表"
            Height          =   180
            Left            =   480
            TabIndex        =   20
            Top             =   600
            Width           =   1440
         End
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "人    员    内    调"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7920
      TabIndex        =   2
      Top             =   480
      Width           =   3255
   End
   Begin VB.CommandButton Command2 
      Caption         =   "人    员    调    出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4320
      TabIndex        =   1
      Top             =   480
      Width           =   3255
   End
   Begin VB.CommandButton Command1 
      Caption         =   "人    员    调    入"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   3255
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "工资管理系统人员管理"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   315
      Left            =   3960
      TabIndex        =   3
      Top             =   0
      Width           =   3300
   End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
   Text1.Text = ""
   Text2.Text = ""
   Text3.Text = ""
   Text4.Text = ""
   Text5.Text = ""
   Text6.Text = ""
   Data1.Recordset.FindFirst "bmmc=" + "'" + Combo1.Text + "'"
   Text1.Text = Data1.Recordset.Fields(0)
   Text1.SelStart = Len(Text1.Text)
   Text1.SetFocus
End Sub

Private Sub Combo1_KeyPress(KeyAscii As Integer)
   KeyAscii = 0
End Sub

Private Sub Combo2_Click()
   Data1.Recordset.FindFirst "bmmc=" + "'" + Combo2.Text + "'"
   bh1 = Data1.Recordset.Fields(0)
   Data2.RecordSource = "select 编号,姓名,基本工资,工龄工资,副食补贴,粮食补贴 from gzb where mid(编号,1,2)=" + bh1
   Data2.Refresh
End Sub

Private Sub Combo3_Click()
   List1.Clear
   Data1.Recordset.FindFirst "bmmc=" + "'" + Combo3.Text + "'"
   xh = Data1.Recordset.Fields(0)
   Data2.Refresh
   While Data2.Recordset.EOF = False
      If Mid(Data2.Recordset.Fields(0), 1, 2) = xh Then
         List1.AddItem Data2.Recordset.Fields(1)
      End If
      Data2.Recordset.MoveNext
   Wend
End Sub

Private Sub Combo4_Click()
   List2.Clear
   Data1.Recordset.FindFirst "bmmc=" + "'" + Combo4.Text + "'"
   xh = Data1.Recordset.Fields(0)
   Data2.Refresh
   While Data2.Recordset.EOF = False
      If Mid(Data2.Recordset.Fields(0), 1, 2) = xh Then
         List2.AddItem Data2.Recordset.Fields(1)
      End If
      Data2.Recordset.MoveNext
   Wend
End Sub

Private Sub Command1_Click()
  Frame1.Visible = True
  Frame1.Left = 600
  Frame1.Top = 1200
  Frame4.Visible = False
  Frame7.Visible = False
  
End Sub

Private Sub Command10_Click()
  Data1.Recordset.FindFirst "bmmc=" + "'" + Combo4.Text + "'"
  drbh1 = Data1.Recordset.Fields(0)
  i = 0
  While i <= List1.ListCount - 1
     If List1.Selected(i) = True Then
        bdxm1 = List1.Text
     End If
     i = i + 1
  Wend
  Data2.Recordset.FindFirst "姓名=" + "'" + bdxm1 + "'"
  drbh2 = drbh1 + Mid(Data2.Recordset.Fields(0), 3, 2)
  Data2.Refresh
  Print drbh2
   chf = 3
  While chf = 3
    Data2.Recordset.FindFirst "编号=" + "'" + drbh2 + "'"
    If Data2.Recordset.NoMatch = False Then
      drbh2 = Trim(Str(Val(drbh2) + 1))
    Else
       chf = 4
    End If
  Wend
  Data2.Refresh
  Data2.Recordset.FindFirst "姓名=" + "'" + bdxm1 + "'"
  Data2.Recordset.Edit
  Data2.Recordset.Fields(0) = drbh2
  Data2.Recordset.Update
  i = 0
  While i <= List1.ListCount - 1
     If List1.Selected(i) = True Then
        List2.AddItem List1.Text
        List1.RemoveItem i
     End If
     i = i + 1
  Wend
  MsgBox "内调成功"
End Sub

Private Sub Command2_Click()
   Frame4.Visible = True
   Frame4.Left = 600
   Frame4.Top = 1200
   Frame1.Visible = False
   Frame7.Visible = False
End Sub

Private Sub Command3_Click()
  Frame7.Visible = True
  Frame7.Left = 600
  Frame7.Top = 1200
  Frame1.Visible = False
  Frame4.Visible = False
  Combo3.Clear
  Combo4.Clear
  Data1.Refresh
  While Data1.Recordset.EOF = False
     Combo3.AddItem Data1.Recordset.Fields(1)
     Combo4.AddItem Data1.Recordset.Fields(1)
     Data1.Recordset.MoveNext
  Wend
  Combo3.Text = "请选择调出部门..."
  Combo4.Text = "请选择调入部门..."
End Sub

Private Sub Command4_Click()
  Data2.Refresh
  Data2.Recordset.FindFirst "编号=" + "'" + Text1.Text + "'"
  If Data2.Recordset.NoMatch = False Then
     MsgBox "此编号已经存在,请重新编号。"
     Text1.Text = Left(Text1.Text, 2)
     Text1.SelStart = Len(Text1.Text)
     Text1.SetFocus
     Exit Sub
  End If
  If Text2.Text = "" Then
     MsgBox "姓名不能为空,请输入姓名"
     Text2.SetFocus
     Exit Sub
  End If
  Data2.Recordset.AddNew
  Data2.Recordset.Fields(0) = Text1.Text
  Data2.Recordset.Fields(1) = Text2.Text
  Data2.Recordset.Fields(2) = Val(Text3.Text)
  Data2.Recordset.Fields(3) = Val(Text4.Text)
  Data2.Recordset.Fields(4) = Val(Text5.Text)
  Data2.Recordset.Fields(5) = Val(Text6.Text)
  For i = 6 To 15
     Data2.Recordset.Fields(i) = 0
  Next i
  Data2.Recordset.Update
  MsgBox "人员调入成功"
  Frame1.Visible = False
End Sub

Private Sub Command5_Click()
  Frame1.Visible = False
End Sub

Private Sub Command6_Click()
  Unload Me
End Sub

Private Sub Command7_Click()
   xh = InputBox("请输入要调出人员的编号")
   Data3.DatabaseName = App.Path + "/gzglxt.mdb"
   Data3.RecordSource = "gzb"
   Data3.Refresh
   Data3.Recordset.FindFirst "编号=" + "'" + xh + "'"
   If Data3.Recordset.NoMatch = True Then
      MsgBox "无此记录,不能调出"
      Exit Sub
   Else
      k = MsgBox("确认调出此职工吗?", vbYesNo + 32)
      If k = 6 Then
         Data3.Recordset.Delete
         MsgBox "此职工已经成功调出"
      End If
   End If
   Data2.Refresh
   Data3.Refresh
End Sub

Private Sub Command9_Click()
   Unload Me
End Sub

Private Sub Form_Activate()
  Frame1.Visible = False
  Frame4.Visible = False
  Frame7.Visible = False
  Data1.Refresh
  While Data1.Recordset.EOF = False
     Combo1.AddItem Data1.Recordset.Fields(1)
     Combo2.AddItem Data1.Recordset.Fields(1)
     Data1.Recordset.MoveNext
  Wend
  Combo2.Text = "请选择..."
End Sub

Private Sub Form_Load()
  Me.Top = 0
  Me.Left = 0
  Me.Height = gzglxt.Height - gzglxt.sb1.Height - 750 - gzglxt.Toolbar1.Height
  Me.Width = gzglxt.Width - 180
  Data1.DatabaseName = App.Path + "\gzglxt.mdb"
  Data1.RecordSource = "bmk"
  Data1.Refresh
  Data2.DatabaseName = App.Path + "\gzglxt.mdb"
  Data2.RecordSource = "gzb"
  Data2.Refresh
End Sub

⌨️ 快捷键说明

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