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

📄 frmcj3.frm

📁 CS 课 程 设 计——— 学生信息管理系统(SIMS) 使用VB+ACCESS编写
💻 FRM
字号:
VERSION 5.00
Begin VB.Form 成绩查询 
   Caption         =   "成绩查询"
   ClientHeight    =   3150
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4590
   LinkTopic       =   "Form1"
   ScaleHeight     =   3150
   ScaleWidth      =   4590
   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          =   2655
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4095
      Begin VB.TextBox Text1 
         BackColor       =   &H80000014&
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   3
         Left            =   1920
         TabIndex        =   4
         Top             =   1680
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000014&
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   2
         Left            =   1920
         TabIndex        =   3
         Top             =   1200
         Width           =   1695
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000014&
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   1
         Left            =   1920
         TabIndex        =   2
         Top             =   720
         Width           =   1695
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取  消"
         Height          =   375
         Left            =   2280
         TabIndex        =   6
         Top             =   2160
         Width           =   1095
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确  定"
         Height          =   375
         Left            =   600
         TabIndex        =   5
         Top             =   2160
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000014&
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   0
         Left            =   1920
         TabIndex        =   1
         Top             =   240
         Width           =   1695
      End
      Begin VB.Label Label5 
         Caption         =   "按姓名查询:"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   840
         TabIndex        =   10
         Top             =   1680
         Width           =   2775
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "学   号:"
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   1080
         TabIndex        =   9
         Top             =   240
         Width           =   810
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "姓   名:"
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   1080
         TabIndex        =   8
         Top             =   720
         Width           =   810
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "班   级:"
         ForeColor       =   &H00000000&
         Height          =   180
         Left            =   1080
         TabIndex        =   7
         Top             =   1200
         Width           =   810
      End
   End
End
Attribute VB_Name = "成绩查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
Dim aa As Integer
 txtsql = ""
If Trim(Text1(0).Text) <> "" Then
  aa = 1
  If txtsql = "" Then
    txtsql = "cj.学号='" & Trim(Text1(0).Text) & "'"
  Else
    txtsql = txtsql & "and cj.学号='" & Trim(Text1(0).Text) & "'"
  End If
End If
If Trim(Text1(1).Text) <> "" Then
aa = 1
  If txtsql = "" Then
    txtsql = "xj.姓名='" & Trim(Text1(1).Text) & "'"
  Else
    txtsql = txtsql & "and xj.姓名='" & Trim(Text1(1).Text) & "'"
  End If
End If
If Trim(Text1(2).Text) <> "" Then
  aa = 1
  If txtsql = "" Then
    txtsql = "xj.班级='" & Trim(Text1(2).Text) & "'"
  Else
    txtsql = txtsql & "and xj.班级='" & Trim(Text1(2).Text) & "'"
  End If
End If
If Trim(Text1(3).Text) <> "" Then
 aa = 1
 txtsql = ""
txtsql = "xj.姓名 like '%" & Trim(Text1(3).Text) & "%'"

End If
If aa = 0 Then
  ss = MsgBox("你至少要输入一个条件以上才能查询!", , " 警告")
  Text1(0).SetFocus
  Exit Sub
  
End If
Dim str As String

str = "select cj.学号,xj.姓名,xj.班级,cj.学期,cj.类型,cj.课程名称,cj.分数 from cj inner join xj on cj.学号=xj.学号 where  " & txtsql

Dim mrc As ADODB.Recordset
Set mrc = ExecuteSQL(str)
If mrc.EOF = True Then
 zzz = MsgBox("对不起,没有此学生的成绩记录!", vbOKOnly, "查询")
   成绩查询.ZOrder (0)
   成绩查询.Text1(0).SetFocus
   Exit Sub
End If

If txtsql = "" Then
 成绩查询结果.selectstr = "select cj.学号,xj.姓名,xj.班级,cj.学期,cj.类型,cj.课程名称,cj.分数 from cj inner join xj on cj.学号=xj.学号 "
Else
 成绩查询结果.selectstr = "select cj.学号,xj.姓名,xj.班级,cj.学期,cj.类型,cj.课程名称,cj.分数 from cj inner join xj on cj.学号=xj.学号 where  " & txtsql
End If

'frmcj1.printstr = txtsql
'find = True
'frmcj1.Caption = "学生成绩查询结果"

成绩查询.Visible = False
'frmcj1.showtitle

成绩查询结果.Show


End Sub

Private Sub Command2_Click()
  Unload Me
End Sub

Private Sub Form_Activate()
find = True
End Sub


Private Sub Form_LostFocus()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
find = False
End Sub

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 39 Then
  KeyAscii = 0
End If
End Sub

⌨️ 快捷键说明

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