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

📄 form11.frm

📁 运动会成绩统计系统。运动员的添加
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form11 
   Caption         =   "运动队情况查询"
   ClientHeight    =   6060
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4815
   LinkTopic       =   "Form11"
   ScaleHeight     =   6060
   ScaleWidth      =   4815
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "运动队情况查询"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   5535
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4575
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1680
         Style           =   2  'Dropdown List
         TabIndex        =   16
         Top             =   3240
         Width           =   1335
      End
      Begin VB.CommandButton Command4 
         Caption         =   "总成绩"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   1800
         TabIndex        =   14
         Top             =   4800
         Width           =   1215
      End
      Begin VB.CommandButton Command3 
         Caption         =   "金牌总数"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   240
         TabIndex        =   13
         Top             =   4800
         Width           =   1215
      End
      Begin VB.ListBox List1 
         Height          =   600
         Left            =   1080
         TabIndex        =   11
         Top             =   1440
         Width           =   1095
      End
      Begin VB.TextBox Text3 
         Height          =   1575
         Left            =   2280
         MultiLine       =   -1  'True
         ScrollBars      =   3  'Both
         TabIndex        =   10
         Top             =   720
         Width           =   2175
      End
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3360
         TabIndex        =   9
         Top             =   4800
         Width           =   1095
      End
      Begin VB.CommandButton Command1 
         Caption         =   "查询"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   3240
         TabIndex        =   8
         Top             =   2400
         Width           =   1215
      End
      Begin VB.OptionButton Option2 
         Caption         =   "队名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   2040
         Width           =   855
      End
      Begin VB.OptionButton Option1 
         Caption         =   "队号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   1560
         Width           =   735
      End
      Begin VB.TextBox Text2 
         Height          =   495
         Left            =   1080
         TabIndex        =   3
         Top             =   840
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   495
         Left            =   120
         TabIndex        =   2
         Top             =   840
         Width           =   735
      End
      Begin VB.Label Label5 
         BorderStyle     =   1  'Fixed Single
         Height          =   735
         Left            =   240
         TabIndex        =   15
         Top             =   3840
         Width           =   2775
      End
      Begin VB.Label Label2 
         Caption         =   "输入查询队号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   12
         Top             =   3240
         Width           =   1335
      End
      Begin VB.Line Line1 
         X1              =   120
         X2              =   4440
         Y1              =   3000
         Y2              =   3000
      End
      Begin VB.Label Label4 
         Caption         =   "用队名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   1080
         TabIndex        =   5
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "用队号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   4
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "基本情况"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   2880
         TabIndex        =   1
         Top             =   360
         Width           =   975
      End
   End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo ErrMsg
'If Text1.Text = "" Or Text2.Text = "" Then
  ' MsgBox "请您输入正确的数据!", vbOKOnly + vbExclamation, "系统提示"
   'Exit Sub
'End If
'Set adors = adocon.Execute("Select * From 运动队4119 where a_noteam4119=" & Text1.Text & "")
If Option1.Value = True Then
If Text1.Text = "" Then
   MsgBox "请您输入正确的队号!", vbOKOnly + vbExclamation, "系统提示"
   Exit Sub
End If
Set adors = adocon.Execute("Select * From 运动队4119 where a_noteam4119=" & Text1.Text & "")
If adors.EOF Then
   MsgBox "没有此队正确的数据!", vbOKOnly + vbExclamation, "系统提示"
   Exit Sub
End If
Text3.Text = "队号:" & " " & adors(0) & "队名:" & " " & adors(1) & "人数:" & " " & adors(2)
End If
If Option2.Value = True Then
If Text2.Text = "" Then
   MsgBox "请您输入正确的队名!", vbOKOnly + vbExclamation, "系统提示"
   Exit Sub
End If
Set adors = adocon.Execute("Select t_name4119 From 运动队4119 where  t_name4119 like '%" & Text2.Text & "%'")
If adors.EOF Then
   MsgBox "没有此队正确的数据!", vbOKOnly + vbExclamation, "系统提示"
   Exit Sub
End If
Do While adors.EOF = False
List1.AddItem adors("t_name4119")
adors.MoveNext
Loop
'Text3.Text = "队号:" & " " & adors(0) & "队名:" & " " & adors(1) & "人数:" & " " & adors(2)
End If
'Set adors = adocon.Execute("Select * From 运动队4119 where  t_name4119 = '" & List1.Text & "'")
'Text3.Text = "队号:" & " " & adors(0) & "队名:" & " " & adors(1) & "人数:" & " " & adors(2)
ErrMsg:
  If Err.Number <> 0 Then
    MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
    Exit Sub
  End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
On Error GoTo ErrMsg
Label5.Caption = ""
If Combo1.Text = "" Then
    MsgBox "您没有正确的选择数据!", vbOKOnly + vbExclamation, "系统提示"
    Exit Sub
End If
Set adors = adocon.Execute("select a_gold4119 from 运动员成绩表4119")
'Set adors = adocon.Execute("select sum(运动员成绩表4119.a_gold4119) from 运动员成绩表4119,运动员4119 where 运动员成绩表4119.a_no4119=运动员4119.a_no4119 and 运动员4119.a_noteam4119='" & Combo1.Text & "'")
If adors.EOF Then
    MsgBox "此队没参赛或没获金牌!", vbOKOnly + vbExclamation, "系统提示"
    Label5.Caption = 0
    Exit Sub
Else
       Set adors = adocon.Execute("select sum(运动员成绩表4119.a_gold4119) from 运动员成绩表4119,运动员4119 where 运动员成绩表4119.a_no4119=运动员4119.a_no4119 and 运动员4119.a_noteam4119='" & Combo1.Text & "'")
       Label5.Caption = adors(0)
End If
'Else
'Label5.Caption = adors(0)
'End If
ErrMsg:
  If Err.Number <> 0 Then
    MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
    Exit Sub
  End If
End Sub

Private Sub Command4_Click()
On Error GoTo ErrMsg
Label5.Caption = ""
If Combo1.Text = "" Then
    MsgBox "您没有正确的选择数据!", vbOKOnly + vbExclamation, "系统提示"
    Exit Sub
End If
Set adors = adocon.Execute("select a_results4119 from 运动员成绩表4119")
'Set adors = adocon.Execute("select sum(运动员成绩表4119.a_results4119) from 运动员成绩表4119,运动员4119 where 运动员成绩表4119.a_no4119=运动员4119.a_no4119 and 运动员4119.a_noteam4119='" & Combo1.Text & "'")
If adors.BOF And adors.EOF Then
    MsgBox "此队没参赛或没获金牌无总成绩!", vbOKOnly + vbExclamation, "系统提示"
    Label5.Caption = 0
    Exit Sub
Else
       Set adors = adocon.Execute("select sum(运动员成绩表4119.a_results4119) from 运动员成绩表4119,运动员4119 where 运动员成绩表4119.a_no4119=运动员4119.a_no4119 and 运动员4119.a_noteam4119='" & Combo1.Text & "'")
       Label5.Caption = adors(0)
End If

If Label5.Caption = "" Then
    Exit Sub
Else
adocon.Execute ("update 运动队成绩表4119 set t_results4119=" & Label5.Caption & " where " & Combo1.Text & "=a_noteam4119")
End If
'Set adors = adocon.Execute("select a_noteam4119 from 运动队成绩表4119 where a_noteam4119=" & Text4.Text & "")
'If adors.EOF Then
    'adocon.Execute ("insert into 运动队成绩表4119 values("")")
ErrMsg:
  If Err.Number <> 0 Then
    MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
    Exit Sub
  End If
End Sub

Private Sub Form_Load()
On Error GoTo ErrMsg
Text1.Enabled = False
Text2.Enabled = False

Dim sql As String
sql = "select a_noteam4119 from 运动员4119"
Set adors = adocon.Execute(sql)
Do While adors.EOF = False
Combo1.AddItem adors(0)
adors.MoveNext
Loop
ErrMsg:
  If Err.Number <> 0 Then
      MsgBox Err.Number & Err.Description, vbOKOnly + vbCritical, "出错提示"
     Exit Sub
  End If

End Sub

Private Sub List1_Click()
Text3.Text = ""
Set adors = adocon.Execute("Select * From 运动队4119 where  t_name4119 = '" & List1.Text & "'")
Text3.Text = "队号:" & " " & adors(0) & "队名:" & " " & adors(1) & "人数:" & " " & adors(2)

End Sub

Private Sub Option1_Click()
Text3.Text = ""
List1.Clear
Text1.Enabled = True
Text2.Enabled = False
End Sub

Private Sub Option2_Click()
Text3.Text = ""
Text2.Enabled = True
Text1.Enabled = False
End Sub

⌨️ 快捷键说明

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