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

📄 f_cundangfeiyong.frm

📁 这是一个药品人事管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
               Left            =   6000
               TabIndex        =   1
               Top             =   360
               Width           =   1935
               _ExtentX        =   3413
               _ExtentY        =   529
               _Version        =   393216
               CheckBox        =   -1  'True
               DateIsNull      =   -1  'True
               Format          =   69795841
               CurrentDate     =   36186
            End
            Begin MSComCtl2.DTPicker DTPickers 
               DataField       =   "存档开始时间"
               Height          =   300
               Index           =   2
               Left            =   2040
               TabIndex        =   2
               Top             =   960
               Width           =   1935
               _ExtentX        =   3413
               _ExtentY        =   529
               _Version        =   393216
               CheckBox        =   -1  'True
               DateIsNull      =   -1  'True
               Format          =   69795841
               CurrentDate     =   36186
            End
            Begin VB.Label lblLabels 
               Caption         =   "结算时间"
               Height          =   255
               Index           =   1
               Left            =   4320
               TabIndex        =   29
               Top             =   360
               Width           =   855
            End
            Begin VB.Label lblLabels 
               Caption         =   "年        度"
               Height          =   255
               Index           =   0
               Left            =   480
               TabIndex        =   28
               Top             =   360
               Width           =   1215
            End
            Begin VB.Label lblLabels 
               Caption         =   "存档开始时间"
               Height          =   255
               Index           =   9
               Left            =   480
               TabIndex        =   27
               Top             =   960
               Width           =   1935
            End
            Begin VB.Label lblLabels 
               Caption         =   "每人每月费用"
               Height          =   255
               Index           =   2
               Left            =   480
               TabIndex        =   24
               Top             =   1560
               Width           =   1935
            End
            Begin VB.Label lblLabels 
               Caption         =   "存档结束时间"
               Height          =   255
               Index           =   3
               Left            =   4320
               TabIndex        =   23
               Top             =   960
               Width           =   1215
            End
            Begin VB.Label lblLabels 
               Caption         =   "存档人数"
               Height          =   255
               Index           =   4
               Left            =   4320
               TabIndex        =   22
               Top             =   1560
               Width           =   1815
            End
            Begin VB.Label lblLabels 
               Caption         =   "公司交款数"
               Height          =   255
               Index           =   5
               Left            =   480
               TabIndex        =   21
               Top             =   2160
               Width           =   1455
            End
            Begin VB.Label lblLabels 
               Caption         =   "离职员工应退金额"
               Height          =   255
               Index           =   6
               Left            =   4320
               TabIndex        =   20
               Top             =   2160
               Width           =   1575
            End
            Begin VB.Label lblLabels 
               Caption         =   "新增人员应补金额"
               Height          =   255
               Index           =   7
               Left            =   480
               TabIndex        =   19
               Top             =   2760
               Width           =   1575
            End
            Begin VB.Label lblLabels 
               Caption         =   "实交金额"
               Height          =   255
               Index           =   8
               Left            =   4320
               TabIndex        =   18
               Top             =   2760
               Width           =   975
            End
         End
      End
   End
End
Attribute VB_Name = "F_CunDangFeiYong"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1

Dim mvBookMark As Variant
Dim mbEditFlag As Boolean


Private Sub DTPickers_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub Form_Load()
Dim oText As TextBox
Dim oDTP As DTPicker
  
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select * from 存档费用", db, adOpenStatic, adLockOptimistic
  
  
  Set DataGrid1.DataSource = adoPrimaryRS
  
  SetButtons True
  
  
  'Bind the text boxes to the data provider
  For Each oText In Me.txtFields
    Set oText.DataSource = adoPrimaryRS
  Next

 
  'Bind the DTPicker to the data provider
  For Each oDTP In Me.DTPickers
    Set oDTP.DataSource = adoPrimaryRS
  Next
  
  Set DTPickers(1).DataSource = adoPrimaryRS
  Set DTPickers(2).DataSource = adoPrimaryRS
  Set DTPickers(0).DataSource = adoPrimaryRS
  
End Sub

Private Sub Form_Unload(Cancel As Integer)
  Screen.MousePointer = vbDefault
End Sub

Private Sub cmdAdd_Click()
  On Error GoTo AddErr
  With adoPrimaryRS
    If Not (.BOF And .EOF) Then
      mvBookMark = .Bookmark
    End If
    .AddNew

    mbAddNewFlag = True
    SetButtons False
  End With
  On Error GoTo 0
  Exit Sub
AddErr:
  MsgBox "增加操作有错误", vbExclamation + vbOKOnly, pTitle
  
End Sub

Private Sub cmdDelete_Click()
  On Error GoTo DeleteErr
  If MsgBox("是否确认删除记录信息?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  With adoPrimaryRS
    .Delete
    .MoveNext
    If .EOF Then .MoveLast
  End With
  On Error GoTo 0
  Exit Sub
DeleteErr:
  MsgBox "删除操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub

Private Sub cmdRefresh_Click()
  'This is only needed for multi user apps
  On Error GoTo RefreshErr
  adoPrimaryRS.Requery
  On Error GoTo 0
  Exit Sub
RefreshErr:
   MsgBox "刷新操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub

Private Sub cmdEdit_Click()
  On Error GoTo EditErr
  mbEditFlag = True
  SetButtons False
  On Error GoTo 0
  Exit Sub

EditErr:
   MsgBox "更改操作有错误", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdCancel_Click()
 ' On Error Resume Next
 On Error GoTo CancelErr


  mbEditFlag = False
  mbAddNewFlag = False
  adoPrimaryRS.CancelUpdate

  If mvBookMark > 0 Then
   adoPrimaryRS.Bookmark = mvBookMark
  Else
   adoPrimaryRS.MoveFirst
  End If
 SetButtons True
  Exit Sub
CancelErr:
   
   MsgBox "取消操作有错误", vbExclamation + vbOKOnly, pTitle
  SetButtons True
End Sub

Private Sub cmdUpdate_Click()
  On Error GoTo UpdateErr
  If MsgBox("是否确认此操作?", vbYesNo + vbQuestion, "系统提示") = vbNo Then Exit Sub
  adoPrimaryRS.UpdateBatch adAffectAll

  If mbAddNewFlag Then
    adoPrimaryRS.MoveLast              'move to the new record
  End If

  mbEditFlag = False
  mbAddNewFlag = False
  SetButtons True

  On Error GoTo 0
  Exit Sub
UpdateErr:
   MsgBox "保存操作有错误", vbExclamation + vbOKOnly, pTitle
   SetButtons True
End Sub

Private Sub cmdClose_Click()
  RSGL.Enabled = True
  Unload Me
End Sub

Private Sub SetButtons(bVal As Boolean)
Dim oText As TextBox

  CmdAdd.Visible = bVal
  cmdEdit.Visible = bVal
  cmdUpdate.Visible = Not bVal
  cmdCancel.Visible = Not bVal
  CmdDelete.Visible = bVal
  cmdClose.Visible = bVal
  cmdRefresh.Visible = bVal
  
  For Each oText In Me.txtFields
     oText.Enabled = Not bVal
  Next


  DTPickers(1).Enabled = Not bVal
  DTPickers(2).Enabled = Not bVal
  DTPickers(0).Enabled = Not bVal
  
  If bVal Then
   Set DataGrid1.DataSource = adoPrimaryRS
  Else
   Set DataGrid1.DataSource = Nothing
  End If
End Sub


Private Sub txtFields_Change(Index As Integer)

If IsNumeric(txtFields(2).Text) And IsNumeric(txtFields(4).Text) Then
    txtFields(5).Text = CDbl(txtFields(2)) * CDbl(txtFields(4))
End If


If IsNumeric(txtFields(5).Text) And IsNumeric(txtFields(6).Text) And IsNumeric(txtFields(7).Text) Then
    txtFields(8).Text = CDbl(txtFields(5)) - CDbl(txtFields(6)) + CDbl(txtFields(7))
End If



End Sub

Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    SendKeys "{TAB}"
End If
End Sub

Private Sub txtFields_LostFocus(Index As Integer)

If Not IsNumeric(txtFields(0).Text) And (txtFields(0).Text <> "") Then
    MsgBox "请在“年度”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(0).SetFocus
     txtFields(0).SelLength = Len(txtFields(0))
     txtFields(0).SelStart = 0
End If

If Not IsNumeric(txtFields(2).Text) And (txtFields(2).Text <> "") Then
    MsgBox "请在“每人每月应交钱数”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(2).SetFocus
     txtFields(2).SelLength = Len(txtFields(2))
     txtFields(2).SelStart = 0
End If

If Not IsNumeric(txtFields(4).Text) And (txtFields(4).Text <> "") Then
    MsgBox "请在“整个公司存档人数”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(4).SetFocus
     txtFields(4).SelLength = Len(txtFields(4))
     txtFields(4).SelStart = 0
End If


If Not IsNumeric(txtFields(5).Text) And (txtFields(5).Text <> "") Then
    MsgBox "请在“整个公司交款数”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(5).SetFocus
     txtFields(5).SelLength = Len(txtFields(5))
     txtFields(5).SelStart = 0
End If

If Not IsNumeric(txtFields(6).Text) And (txtFields(6).Text <> "") Then
    MsgBox "请在“离职员工应退钱数”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(6).SetFocus
     txtFields(6).SelLength = Len(txtFields(6))
     txtFields(6).SelStart = 0
End If

If Not IsNumeric(txtFields(7).Text) And (txtFields(7).Text <> "") Then
    MsgBox "请在“新增人员应补钱数”中输入数字", vbExclamation + vbOKOnly, pTitle
     txtFields(7).SetFocus
     txtFields(7).SelLength = Len(txtFields(7))
     txtFields(7).SelStart = 0
End If


End Sub

⌨️ 快捷键说明

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