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

📄 frm_xxtj.frm

📁 很好的行政管理系统,供大家享用,功能非常强大,希望大家的支持
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_xxtj 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "添加时间段信息"
   ClientHeight    =   2805
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4980
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   2805
   ScaleWidth      =   4980
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Save 
      Caption         =   "保存"
      Enabled         =   0   'False
      Height          =   315
      Left            =   3960
      TabIndex        =   7
      Top             =   2445
      Width           =   930
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删除"
      Height          =   315
      Left            =   2910
      TabIndex        =   6
      Top             =   2445
      Width           =   1005
   End
   Begin VB.CommandButton Command1 
      Caption         =   "添加"
      Height          =   315
      Left            =   1860
      TabIndex        =   5
      Top             =   2445
      Width           =   1005
   End
   Begin VB.Frame Frame1 
      Caption         =   "信息添加"
      Height          =   2295
      Left            =   105
      TabIndex        =   0
      Top             =   105
      Width           =   4785
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   2850
         Style           =   2  'Dropdown List
         TabIndex        =   9
         Top             =   525
         Width           =   1065
      End
      Begin VB.TextBox Text1 
         Height          =   855
         Left            =   210
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   4
         Top             =   1260
         Width           =   4320
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "frm_xxtj.frx":0000
         Left            =   795
         List            =   "frm_xxtj.frx":0022
         Style           =   2  'Dropdown List
         TabIndex        =   2
         Top             =   525
         Width           =   1065
      End
      Begin VB.Label Label3 
         Caption         =   "年份"
         Height          =   210
         Left            =   255
         TabIndex        =   8
         Top             =   630
         Width           =   480
      End
      Begin VB.Label Label2 
         Caption         =   "时间段信息"
         Height          =   315
         Left            =   255
         TabIndex        =   3
         Top             =   975
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "第几周"
         Height          =   255
         Left            =   2085
         TabIndex        =   1
         Top             =   615
         Width           =   705
      End
   End
End
Attribute VB_Name = "frm_xxtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim StrNum As Integer
Private Sub Cmd_Save_Click()
   If Text1.Text = "" Or Combo1.Text = "" Then
      MsgBox "输入信息不能为空值", 48, "提示信息"
   Else
    On Error Resume Next
       AdoRs.Open "select * from 一周工作安排 where 年份='" + Combo1.Text + "' and 第几周='" + Combo2.Text + "'", Cnn, adOpenKeyset
         If AdoRs.RecordCount > 0 Then
              MsgBox "该信息已经存在", 48, "提示信息"
              AdoRs.Close
         Else
            c = MsgBox("确认保存信息吗", 33, "提示信息")
              If c = vbOK Then
                Set AdoRs = Cnn.Execute("insert into 一周工作安排 values(" & StrNum _
                & ",'" & Combo1 & "','" & Combo2 & "',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','" & Text1 & "')")
                MsgBox "数据保存成功", 64, "提示信息"
              End If
         End If
       AdoRs.Close
  End If
End Sub

Private Sub Command1_Click()
 AdoRs.Open "select * from 一周工作安排 order by ID", Cnn, adOpenKeyset
   If AdoRs.RecordCount > 0 Then
      AdoRs.MoveLast
        StrNum = Val(AdoRs.Fields("ID")) + 1
    Else
        StrNum = 1
    End If
  Text1.Text = ""
  Text1.SetFocus
  Cmd_Save.Enabled = True
  AdoRs.Close
End Sub

Private Sub Command2_Click()
   c = MsgBox("确认删除该信息吗", 17, "提示信息")
      If c = vbOK Then
         Set AdoRs = Cnn.Execute("Delete 一周工作安排 from 一周工作安排 where 年份='" + Combo1.Text + "' and 第几周='" + Combo2.Text + "'")
         MsgBox "信息已经被删除", 48, "提示信息"
      End If
End Sub

Private Sub Form_Load()
 For i = 1 To 52
    StrWeek = "第" & i & "周"
    Combo2.AddItem (StrWeek)
 Next i

End Sub

⌨️ 快捷键说明

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