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

📄 frmsettime.frm

📁 VB开发的毕业设计,绝对不是网上下载的,大家可以去看看,作为参考
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSetTime 
   Caption         =   "设置上下班时间"
   ClientHeight    =   2775
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4170
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   2775
   ScaleWidth      =   4170
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2160
      TabIndex        =   7
      Top             =   2040
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   6
      Top             =   2040
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   1335
      Left            =   240
      TabIndex        =   1
      Top             =   480
      Width           =   3495
      Begin VB.TextBox EndTime 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   1440
         TabIndex        =   5
         Top             =   720
         Width           =   1600
      End
      Begin VB.TextBox BeginTime 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   1440
         TabIndex        =   3
         Top             =   240
         Width           =   1600
      End
      Begin VB.Label Label3 
         Alignment       =   1  'Right Justify
         Caption         =   "下班时间:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   4
         Top             =   720
         Width           =   1335
      End
      Begin VB.Label Label2 
         Alignment       =   1  'Right Justify
         Caption         =   "上班时间:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   240
         Width           =   1215
      End
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "设置上下班时间"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   255
      Left            =   1080
      TabIndex        =   0
      Top             =   120
      Width           =   1815
   End
End
Attribute VB_Name = "frmSetTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
    Unload Me
    Exit Sub
End Sub

Private Sub cmdOK_Click()
On Error Resume Next
    Dim SQL As String
    Dim rs As New ADODB.Recordset
    SQL = "delete from TimeSetting"
    TransactSQL (SQL)
    If IsDate(Me.BeginTime) = False Or Me.BeginTime = "" Then
        MsgBox "请正确地输入时间!", vbOKOnly + vbExclamation, "警告!"
        Me.BeginTime.SetFocus
    Else
        If IsDate(Me.EndTime) = False Or Me.EndTime = "" Then
            MsgBox "请正确地输入时间!", vbOKOnly + vbExclamation, "警告!"
            Me.EndTime.SetFocus
    Else
        SQL = "select * from TimeSetting"
        Set rs = TransactSQL(SQL)
        rs.AddNew                               '设置时间
            rs.Fields(0) = Me.BeginTime
            rs.Fields(1) = Me.EndTime
            rs.Update
            rs.Close
        MsgBox "时间已经设置!", vbOKOnly + vbExclamation, "设置结果!"
        End If
    End If
    Unload Me
End Sub

Private Sub Form_Load()
On Error Resume Next
    Dim SQL As String
    Dim rs As New ADODB.Recordset
    SQL = "select * from TimeSetting"
    Set rs = TransactSQL(SQL)
    If rs.EOF = True Then
        Me.BeginTime = ""
        Me.EndTime = ""
    Else
        Me.BeginTime = rs(0)
        Me.EndTime = rs(1)
    End If
    rs.Close
End Sub

⌨️ 快捷键说明

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