frmcjsz.frm

来自「企业工资管理系统的具体实现」· FRM 代码 · 共 243 行

FRM
243
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmcjsz 
   Caption         =   "车间设置"
   ClientHeight    =   3375
   ClientLeft      =   3390
   ClientTop       =   1770
   ClientWidth     =   4860
   Icon            =   "frmcjsz.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3375
   ScaleWidth      =   4860
   Begin VB.CommandButton cmdexit 
      Caption         =   "退  出"
      Height          =   375
      Left            =   4005
      TabIndex        =   5
      Top             =   2925
      Width           =   795
   End
   Begin VB.CommandButton cmddelete 
      Caption         =   "删  除"
      Height          =   375
      Left            =   3180
      TabIndex        =   4
      Top             =   2925
      Width           =   795
   End
   Begin VB.CommandButton cmdmodify 
      Caption         =   "修  改"
      Height          =   375
      Left            =   2340
      TabIndex        =   3
      Top             =   2925
      Width           =   795
   End
   Begin VB.CommandButton cmdadd 
      Caption         =   "添  加"
      Height          =   375
      Left            =   1500
      TabIndex        =   2
      Top             =   2925
      Width           =   795
   End
   Begin VB.Frame Frame1 
      Height          =   2895
      Left            =   30
      TabIndex        =   0
      Top             =   -75
      Width           =   4770
      Begin MSAdodcLib.Adodc adowork 
         Height          =   345
         Left            =   990
         Top             =   1860
         Visible         =   0   'False
         Width           =   1200
         _ExtentX        =   2117
         _ExtentY        =   609
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin MSDataGridLib.DataGrid DataGrid1 
         Height          =   2715
         Left            =   60
         TabIndex        =   1
         Top             =   135
         Width           =   4665
         _ExtentX        =   8229
         _ExtentY        =   4789
         _Version        =   393216
         AllowUpdate     =   0   'False
         HeadLines       =   1
         RowHeight       =   15
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   "cjdh"
            Caption         =   "车间代号"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cjm"
            Caption         =   "车间名"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
   End
End
Attribute VB_Name = "frmcjsz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdadd_Click()
flag = 1
frmcjsz1.Show 1
End Sub

Private Sub cmddelete_Click()
Dim Count As Integer
On Error GoTo err2
If MsgBox("你真的要删除此记录吗?", vbInformation + vbYesNo, "提示") = vbYes Then
    With adowork
        .Recordset.Delete
        .Recordset.Update
    End With
Else
    Exit Sub
End If
Exit Sub
err2:
    If Err.Number = -2147217864 Then
        MsgBox "记录已到尾!", vbInformation, "提示"
        adowork.Recordset.MovePrevious
        Exit Sub
    End If

End Sub

Private Sub cmdexit_Click()
Unload Me
End Sub

Private Sub cmdmodify_Click()
On Error GoTo err1
With Me.adowork.Recordset
    If Me.cmdmodify.Caption = "修  改" Then
        If .RecordCount > 0 Then
            Me.DataGrid1.AllowUpdate = True
'            Me.DataGrid1.AllowAddNew = True
            Me.cmdmodify.Caption = "保  存"
            Me.cmdadd.Enabled = False
            Me.cmddelete.Enabled = False
            Me.cmdexit.Enabled = False
        Else
            Exit Sub
        End If
    Else
         .Update
         If Not .EOF And .BOF Then .MoveFirst
         Me.cmdmodify.Caption = "修  改"
         Me.cmdadd.Enabled = True
         Me.cmddelete.Enabled = True
         Me.cmdexit.Enabled = True
    End If
End With
err1:
    If Err.Number = "-2147467259" Then
        MsgBox "车间代码不能为空,请输入后再保存!", vbInformation, "提示"
        Exit Sub
    End If
End Sub

Private Sub Form_Load()
With adowork
    .ConnectionString = constr
    .RecordSource = "select * from cjb order by cjdh"
    .Refresh
    If Not .Recordset.EOF And .Recordset.BOF Then .Recordset.MoveFirst
End With
Set DataGrid1.DataSource = adowork
End Sub

⌨️ 快捷键说明

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