?? frm_searchstudent.frm
字號:
VERSION 5.00
Begin VB.Form frm_SearchStudent
Caption = "Student Search Form"
ClientHeight = 5445
ClientLeft = 60
ClientTop = 450
ClientWidth = 8460
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5445
ScaleWidth = 8460
Begin VB.Frame Frame1
Height = 3135
Left = 240
TabIndex = 2
Top = 1800
Width = 7335
Begin VB.CommandButton Command1
Caption = "Preview"
Height = 495
Left = 2400
TabIndex = 7
Top = 2160
Width = 2415
End
Begin VB.ComboBox cmb_Rollno
Height = 315
Left = 2880
Style = 2 'Dropdown List
TabIndex = 6
Top = 1200
Width = 2655
End
Begin VB.ComboBox cmb_Class
Height = 315
Left = 2880
Style = 2 'Dropdown List
TabIndex = 4
Top = 480
Width = 2655
End
Begin VB.Label Label2
Caption = "Select Rollno"
Height = 375
Left = 1320
TabIndex = 5
Top = 1200
Width = 1335
End
Begin VB.Label Label1
Caption = "Select Class"
Height = 375
Left = 1320
TabIndex = 3
Top = 480
Width = 2415
End
End
Begin VB.PictureBox Picture3
Height = 1575
Left = -240
Picture = "frm_SearchStudent.frx":0000
ScaleHeight = 1515
ScaleWidth = 11955
TabIndex = 0
Top = 0
Width = 12015
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Select Class and Student"
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 = 720
TabIndex = 1
Top = 360
Width = 6660
End
End
End
Attribute VB_Name = "frm_SearchStudent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim course_id As Integer
Private Sub cmb_Class_Click()
Dim Rs As New ADODB.Recordset
If (Trim(cmb_Class.Text) <> "") Then
Rs.Open "select course_id from course where course_name='" & Trim(cmb_Class.Text) & "'", frmMain.Cn, 2, 3
course_id = Rs!course_id
Rs.Close
Rs.Open "select * from qry_Studentcourse where course_name='" & Trim(cmb_Class.Text) & "'", frmMain.Cn, 2, 3
cmb_Rollno.Clear
Do While Not Rs.EOF
cmb_Rollno.AddItem Rs!stud_id
Rs.MoveNext
Loop
End If
Set Rs = Nothing
End Sub
Private Sub Command1_Click()
Dim Rs As New ADODB.Recordset
If (Trim(cmb_Class.Text) <> "" And Trim(cmb_Rollno.Text) <> "") Then
Rs.Open "select * from qry_Studentcourse where course_name='" & Trim(cmb_Class.Text) & "' and Stud_id=" & Val(cmb_Rollno.Text), frmMain.Cn, 2, 3
Set DataReport1.DataSource = Rs
DataReport1.Show
Unload Me
End If
End Sub
Private Sub Form_Load()
Dim Rs As New ADODB.Recordset
Rs.Open "select * from course", frmMain.Cn, 2, 3
Do While Not Rs.EOF
cmb_Class.AddItem Rs!course_Name
Rs.MoveNext
Loop
Rs.Close
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -