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

📄 frmcount.frm

📁 该系统的最终用户是访问本系统的工作人员
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmcount 
   Caption         =   "卫生检查评分计算中心"
   ClientHeight    =   6165
   ClientLeft      =   3900
   ClientTop       =   2820
   ClientWidth     =   8400
   LinkTopic       =   "Form1"
   ScaleHeight     =   6165
   ScaleWidth      =   8400
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   2
      Top             =   5790
      Width           =   8400
      _ExtentX        =   14817
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   1
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Text            =   "计算中心"
            TextSave        =   "计算中心"
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame2 
      Caption         =   "保存信息"
      Height          =   1455
      Left            =   240
      TabIndex        =   1
      Top             =   4080
      Width           =   7815
      Begin VB.CommandButton Command3 
         BackColor       =   &H00E0E0E0&
         Caption         =   "取消"
         Height          =   495
         Left            =   4200
         Style           =   1  'Graphical
         TabIndex        =   14
         Top             =   600
         Width           =   1815
      End
      Begin VB.CommandButton Command2 
         BackColor       =   &H00E0E0E0&
         Caption         =   "保存以上计算信息"
         Height          =   495
         Left            =   1200
         Style           =   1  'Graphical
         TabIndex        =   13
         Top             =   600
         Width           =   1695
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "计算信息"
      Height          =   3135
      Left            =   240
      TabIndex        =   0
      Top             =   840
      Width           =   7815
      Begin VB.CommandButton Comcount 
         BackColor       =   &H00E0E0E0&
         Caption         =   "确认计算"
         Height          =   615
         Left            =   4200
         Style           =   1  'Graphical
         TabIndex        =   12
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox Text8 
         BackColor       =   &H00C0E0FF&
         Height          =   510
         Left            =   5880
         TabIndex        =   11
         Top             =   1920
         Width           =   1215
      End
      Begin VB.TextBox Text7 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   2520
         TabIndex        =   10
         Top             =   1920
         Width           =   1095
      End
      Begin VB.TextBox Text6 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   5880
         TabIndex        =   9
         Top             =   480
         Width           =   1215
      End
      Begin VB.TextBox Text5 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   4200
         TabIndex        =   8
         Top             =   480
         Width           =   1215
      End
      Begin VB.TextBox Text4 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   2520
         TabIndex        =   7
         Top             =   480
         Width           =   1095
      End
      Begin VB.TextBox Text3 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   840
         TabIndex        =   6
         Top             =   1920
         Width           =   1095
      End
      Begin VB.TextBox Text2 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   840
         TabIndex        =   5
         Top             =   1200
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00C0E0FF&
         Height          =   495
         Left            =   840
         TabIndex        =   4
         Top             =   480
         Width           =   1095
      End
      Begin VB.Label Label9 
         BackStyle       =   0  'Transparent
         Caption         =   "平均分"
         Height          =   255
         Left            =   5880
         TabIndex        =   22
         Top             =   1680
         Width           =   615
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "总分"
         Height          =   255
         Left            =   2640
         TabIndex        =   21
         Top             =   1680
         Width           =   495
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "评分3"
         Height          =   255
         Left            =   6000
         TabIndex        =   20
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "评分2"
         Height          =   255
         Left            =   4320
         TabIndex        =   19
         Top             =   240
         Width           =   855
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "评分1"
         Height          =   255
         Left            =   2640
         TabIndex        =   18
         Top             =   240
         Width           =   615
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "寝室号"
         Height          =   255
         Left            =   240
         TabIndex        =   17
         Top             =   2160
         Width           =   615
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "栋号"
         Height          =   255
         Left            =   360
         TabIndex        =   16
         Top             =   1440
         Width           =   375
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "输入日期"
         Height          =   255
         Left            =   120
         TabIndex        =   15
         Top             =   720
         Width           =   735
      End
   End
   Begin VB.Label title 
      BackStyle       =   0  'Transparent
      Caption         =   "卫生检查评分计算"
      BeginProperty Font 
         Name            =   "新宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   3
      Top             =   240
      Width           =   2895
   End
End
Attribute VB_Name = "frmcount"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Comcount_Click()
Dim m As Single, n As Single, t As Single, all As Single

Dim avg As Double

If Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Then
MsgBox "请输入您要的数据!", vbOKCancel + vbCritical, "警告"
Text4.SetFocus
Else
 m = Val(Text4.Text)
 n = Val(Text5.Text)
 t = Val(Text6.Text)
 Text7.Text = m + n + t
 Text8.Text = Val(Text7.Text) / 3
 If Text8.Text >= 92 Then
 MsgBox "此次检查该寝室卫生非常好,应得优秀!,希望继续保持!", vbOKOnly + vbInformation, "通知"
 End If
 
End If

End Sub

Private Sub Command2_Click()
Dim mrc As ADODB.Recordset
    Dim txtSQL As String
    Dim MsgText As String
    
    If Not Testtxt(Text1.Text) Then
        MsgBox "请输入检查日期!输入日期应输入日期格式(yyyy-mm-dd)!", vbOKOnly + vbExclamation, "警告"
        Text1.SetFocus
     
        Exit Sub
        
    End If
    
    If Not Testtxt(Text2.Text) Then
        MsgBox "请输入栋号!", vbOKOnly + vbExclamation, "警告"
        Text1.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(Text3.Text) Then
        MsgBox "请输入寝室号!", vbOKOnly + vbExclamation, "警告"
        Exit Sub
    End If
    
    If Not Testtxt(Text4.Text) Then
        MsgBox "请输入评分1!", vbOKOnly + vbExclamation, "警告"
        Text4.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(Text5.Text) Then
        MsgBox "请输入评分2!", vbOKOnly + vbExclamation, "警告"
        Text5.SetFocus
        Exit Sub
    End If
    
    If Not Testtxt(Text6.Text) Then
        MsgBox "请输入评分3!", vbOKOnly + vbExclamation, "警告"
       Text6.SetFocus
        Exit Sub
    End If
    
    txtSQL = "select * from hygiene_check where 日期 = '" & Text1.Text & "' and 栋号= '" & Text2.Text & "' and 寝室号 = '" & Text3.Text & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
        MsgBox "有相同纪录,请重新输入信息!", vbOKOnly + vbExclamation, "警告"
        mrc.Close
          Text1.Text = ""
        Text2.Text = ""
        Text3.Text = ""
        Text4.Text = ""
        Text5.Text = ""
        Text6.Text = ""
        Text7.Text = ""
        Text8.Text = ""
        Text1.SetFocus
    
    Else
        mrc.AddNew
        mrc.Fields(0) = Text1.Text
        mrc.Fields(1) = Text2.Text
        mrc.Fields(2) = Text3.Text
        mrc.Fields(3) = Text4.Text
        mrc.Fields(4) = Text5.Text
        mrc.Fields(5) = Text6.Text
        mrc.Fields(6) = Text7.Text
        mrc.Fields(7) = Text8.Text
        mrc.Update
        mrc.Close
        MsgBox "保存计算信息成功!", vbOKOnly + vbExclamation, "警告"
     
        Text1.Text = ""
        Text2.Text = ""
        Text3.Text = ""
        Text4.Text = ""
        Text5.Text = ""
        Text6.Text = ""
        Text7.Text = ""
        Text8.Text = ""
        Text1.SetFocus
        
          
    End If


End Sub

Private Sub Command3_Click()
Unload Me

End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then Text2.SetFocus
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then Text3.SetFocus
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then Text4.SetFocus
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then Text5.SetFocus
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then Text6.SetFocus
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then Comcount.SetFocus
End Sub

⌨️ 快捷键说明

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