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

📄 frmouter.frm

📁 监控类的开发
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4320
      TabIndex        =   4
      Top             =   3480
      Width           =   735
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确认"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5280
      TabIndex        =   3
      ToolTipText     =   "修改或增加"
      Top             =   3480
      Width           =   735
   End
   Begin VB.CommandButton cmdClear 
      Caption         =   "清除"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2400
      TabIndex        =   6
      Top             =   3480
      Width           =   735
   End
   Begin VB.TextBox txtAreaCode 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1320
      MaxLength       =   2
      TabIndex        =   0
      ToolTipText     =   "两位数字(1-99)"
      Top             =   2880
      Width           =   495
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      Caption         =   "备注"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6240
      TabIndex        =   12
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      Caption         =   "手机"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3960
      TabIndex        =   11
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "姓名"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2040
      TabIndex        =   9
      Top             =   3000
      Width           =   615
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      Caption         =   "区域代码"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   3000
      Width           =   1095
   End
End
Attribute VB_Name = "frmOuter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClear_Click()
    txtAreaCode.Text = ""
    txtName.Text = ""
    txtMb.Text = ""
    txtRemark.Text = ""
End Sub

Private Sub cmdDel_Click()
    Dim nTmp As Integer
    Dim nRet As Integer
    On Error Resume Next 'CallerID
    
    With AdodcCaller.Recordset
        If .EOF Or .BOF Or .RecordCount < 1 Then Exit Sub
        nTmp = ![AreaCode]
        nRet = MsgBox("确信删除区域代码为:" + Trim(Str(nTmp)) + " 的记录吗?", vbQuestion + vbYesNo, "提示")
        If nRet = 6 Then
            .Delete
            .Requery
            AdjustNumber AdodcCaller, 1
        End If
    End With
End Sub

Private Sub cmdOK_Click()
    Dim nTmp As Integer
    Dim bAddNew As Boolean
    On Error Resume Next 'CallerID
    
    nTmp = Val(txtAreaCode.Text)
    If nTmp < 1 Or nTmp > 99 Then
        MsgBox "区域代码必须在1至99之间!", vbQuestion + vbOKOnly, "提示"
        txtAreaCode.SetFocus
        Exit Sub
    End If
    
    If Len(txtName.Text) < 2 Then
        MsgBox "外勤员工的姓名至少两个字以上!", vbQuestion + vbOKOnly, "提示"
        txtName.SetFocus
        Exit Sub
    End If
    
    If CheckMb(txtMb.Text) = False Then
        MsgBox "手机号码输入有误!", vbCritical + vbOKOnly, "错误"
        txtMb.SetFocus
        Exit Sub
    End If
    
    With AdodcCaller.Recordset
        If .RecordCount < 1 Then
            bAddNew = True
        Else
            .MoveFirst
            Do While Not .EOF
                If ![AreaCode] = nTmp Then Exit Do
                .MoveNext
            Loop
                    
            If .EOF Then bAddNew = True
        End If
        
        On Error GoTo END_MARK
        If bAddNew = True Then .AddNew
        ![AreaCode] = nTmp
        ![Name] = Trim(txtName.Text)
        ![Mb] = Trim(txtMb.Text)
        ![Remark] = Trim(txtRemark.Text)
        .Update
        .Requery
    End With
    
    frmMain.GetCorpInfo
END_MARK:
End Sub

Private Sub cmdQuit_Click()
    Unload Me
End Sub

Private Sub DataGrid1_Click()
    On Error Resume Next 'CallerID
    
    With AdodcCaller.Recordset
        If (.RecordCount > 0) And (Not (.EOF Or .BOF)) Then
            txtAreaCode.Text = ![AreaCode]
            txtName.Text = ![Name]
            txtMb.Text = ![Mb]
            txtRemark.Text = ![Remark]
            cmdDel.Enabled = True
        Else
            cmdDel.Enabled = False
        End If
    End With
End Sub

Private Sub Form_Load()
    On Error Resume Next 'CallerID
    
    With AdodcCaller
        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
                          strDataPath + ";Persist Security Info=False"
        .CommandType = adCmdUnknown
        .RecordSource = "select * from Outers order by [AreaCode]"
        .Refresh
        
        If .Recordset.RecordCount > 0 Then
            cmdDel.Enabled = True
        Else
            cmdDel.Enabled = False
        End If
    End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
    AdjustNumber AdodcCaller, 1
End Sub

⌨️ 快捷键说明

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