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

📄 frmstudreport.frm

📁 This project is developed for school management system in vb and sql server 2000. All source code in
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmStudReport 
   AutoRedraw      =   -1  'True
   BackColor       =   &H80000004&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Student Report..."
   ClientHeight    =   6210
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8055
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmStudReport.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6210
   ScaleWidth      =   8055
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.PictureBox Picture6 
      Height          =   1575
      Left            =   -840
      Picture         =   "frmStudReport.frx":000C
      ScaleHeight     =   1515
      ScaleWidth      =   12060
      TabIndex        =   7
      Top             =   0
      Width           =   12120
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Students  Entry Form"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000006&
         Height          =   570
         Left            =   1560
         TabIndex        =   8
         Top             =   360
         Width           =   5760
      End
   End
   Begin VB.CheckBox CMain 
      BackColor       =   &H80000004&
      Caption         =   "P&review Report before Printing..."
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   1320
      TabIndex        =   5
      Top             =   4440
      Value           =   1  'Checked
      Width           =   4365
   End
   Begin VB.PictureBox p 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      ForeColor       =   &H80000008&
      Height          =   525
      Left            =   1920
      ScaleHeight     =   495
      ScaleWidth      =   2985
      TabIndex        =   2
      Top             =   5160
      Width           =   3015
      Begin VB.CommandButton Command2 
         Caption         =   "Cancel"
         Height          =   315
         Left            =   1590
         TabIndex        =   4
         Top             =   90
         Width           =   1185
      End
      Begin VB.CommandButton cmdOK 
         Caption         =   "&Print.."
         Height          =   315
         Left            =   240
         TabIndex        =   3
         Top             =   90
         Width           =   1185
      End
   End
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      Caption         =   "Check the Options You want to use:"
      ForeColor       =   &H80000008&
      Height          =   1695
      Left            =   1080
      TabIndex        =   0
      Top             =   2400
      Width           =   4935
      Begin VB.CheckBox C3 
         BackColor       =   &H80000004&
         Caption         =   "Pri&nt Letter Label ..."
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   360
         TabIndex        =   6
         Top             =   1080
         Width           =   2895
      End
      Begin VB.CheckBox C1 
         BackColor       =   &H80000004&
         Caption         =   "&Congrulation Report to Student...."
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   360
         TabIndex        =   1
         Top             =   540
         Width           =   3405
      End
   End
End
Attribute VB_Name = "frmStudReport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim j As Double
Dim a As Boolean, B As Boolean, C As Boolean
Dim CM As Boolean

Private Sub CMain_Click()

 With CMain
 .Value = vbChecked
  If .Value = vbChecked Then
    cmdOK.Caption = "&Preview.."
  Else
    cmdOK.Caption = "&Print.."
  End If
End With
  
End Sub
Private Sub cmdOK_Click()
a = C1.Value

C = C3.Value
CM = CMain.Value
If a = False And C = False Then
 MsgBox "No Option is Selected ,Please Select an option first", vbInformation, App.Comments
 Exit Sub
End If
 
 If a = True Then
   C1_Report
 End If
 If C = True Then
   C3_Report
 End If
 
End Sub

Private Sub Command2_Click()
 Unload Me
End Sub

Public Sub C1_Report()
  Dim Rs As New ADODB.Recordset
  sq = "Select * from student where stud_id = " & j
  
   
 If Rs.State = 1 Then Rs.Close
 Rs.CursorLocation = adUseClient
   Rs.Open sq, frmMain.Cn
 
 If Rs.RecordCount = 0 Then
   MsgBox "There is no Record to Print..." & vbCrLf & "Canceling Report....", vbInformation, App.Comments
 End If
  With rptCongrulate
    Set .DataSource = Rs
   .Sections("Det").Controls("t0").DataField = "Name"
   .Sections("Det").Controls("t1").DataField = "Father_name"
   .Sections("Det").Controls("t2").DataField = "Address"
   .Sections("Det").Controls("t3").DataField = "Session"
   .Sections("Det").Controls("t4").DataField = "Stud_id"
   Unload frmStudReport
   If CM = True Then
     
     '.WindowState = vbMaximized
    
     .Refresh
     .Show
   Else
    
    .PrintReport
     Unload rptCongrulate
   End If
  End With
 
End Sub



Private Sub Form_Load()
Dither Me
 j = frmStudent.T(18).Text
 frmMain.Enabled = False
 CMain_Click
End Sub
Public Sub C3_Report()
  Dim Rs As New ADODB.Recordset
  sq = "Select * from student where stud_id = " & j
  
   
 If Rs.State = 1 Then Rs.Close
 Rs.CursorLocation = adUseClient
   Rs.Open sq, frmMain.Cn
 
 If Rs.RecordCount = 0 Then
   MsgBox "There is no Record to Print..." & vbCrLf & "Canceling Report....", vbInformation, App.Comments
 End If
  With rptStudLabel
    Set .DataSource = Rs
   .Sections("Det").Controls("t0").DataField = "Name"
   .Sections("Det").Controls("t2").DataField = "Address"
   Unload frmStudReport
   If CM = True Then
     
     '.WindowState = vbMaximized
     .Refresh
     .Show
   Else
   
    .PrintReport
'        .Refresh
 Unload rptStudLabel
   End If
  End With
 
End Sub

Private Sub Form_Unload(Cancel As Integer)
frmMain.Enabled = True
End Sub

⌨️ 快捷键说明

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