-
Notifications
You must be signed in to change notification settings - Fork 0
/
Frm_getteacher_id.frm
179 lines (172 loc) · 5.41 KB
/
Frm_getteacher_id.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form Frm_getteacher_id
BorderStyle = 3 'Fixed Dialog
Caption = "Teacher ID's"
ClientHeight = 3855
ClientLeft = 45
ClientTop = 390
ClientWidth = 6375
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3855
ScaleWidth = 6375
ShowInTaskbar = 0 'False
Begin VB.CommandButton cmd_back
Caption = "Back"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 4
Top = 120
Width = 615
End
Begin VB.ComboBox cmb_dept_name
BeginProperty Font
Name = "Times New Roman"
Size = 11.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
Style = 2 'Dropdown List
TabIndex = 2
Top = 480
Width = 4695
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 2415
Left = 120
TabIndex = 0
Top = 1320
Width = 6135
_ExtentX = 10821
_ExtentY = 4260
_Version = 393216
Rows = 1
FixedRows = 0
FixedCols = 0
BackColorBkg = -2147483633
FillStyle = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label8
Caption = "Department"
BeginProperty Font
Name = "Lucida Handwriting"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 3
Top = 480
Width = 1215
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "Teachers List"
BeginProperty Font
Name = "Lucida Handwriting"
Size = 12
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 240
TabIndex = 1
Top = 840
Width = 5895
End
End
Attribute VB_Name = "Frm_getteacher_id"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmb_dept_name_Click()
MSFlexGrid1.Clear
MSFlexGrid1.RowHeight(0) = 350
MSFlexGrid1.Appearance = flex3D
MSFlexGrid1.BackColorBkg = vbWhite
MSFlexGrid1.FillStyle = flexFillRepeat
MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 0
MSFlexGrid1.RowSel = 0
MSFlexGrid1.ColSel = 1
MSFlexGrid1.BackColorSel = &H80000014
MSFlexGrid1.ForeColorSel = &H80000013
MSFlexGrid1.CellFontBold = True
MSFlexGrid1.CellFontName = "Broadway"
MSFlexGrid1.CellFontSize = 10
MSFlexGrid1.CellFontUnderline = True
MSFlexGrid1.CellTextStyle = flexTextInsetLight
MSFlexGrid1.ColWidth(0) = 2000
MSFlexGrid1.ColWidth(1) = 4000
MSFlexGrid1.TextMatrix(0, 0) = "ID"
MSFlexGrid1.TextMatrix(0, 1) = "Name"
Call connection
rs.Open "select count(id) from teacher where deptid=(select id from department where name = '" & cmb_dept_name & "')", conn, adOpenDynamic, adLockBatchOptimistic
Dim n As Integer
n = rs.Fields(0)
Call connection
rs.Open "select id,name from teacher where deptid=(select id from department where name = '" & cmb_dept_name & "')", conn, adOpenDynamic, adLockBatchOptimistic
While (rs.EOF = False)
MSFlexGrid1.Rows = n + 1
For i = 1 To n
MSFlexGrid1.TextMatrix(i, 0) = (rs.Fields(0))
MSFlexGrid1.TextMatrix(i, 1) = (rs.Fields(1))
rs.MoveNext
Next
Wend
End Sub
Private Sub cmd_back_Click()
Unload Me
Frm_sub_assignment.Show
End Sub
Private Sub Form_Load()
Call connection
rs.Open "select * from department", conn, adOpenDynamic, adLockBatchOptimistic
cmb_dept_name.Clear
While (rs.EOF = False)
cmb_dept_name.AddItem (rs.Fields(1))
rs.MoveNext
Wend
End Sub
Private Sub MSFlexGrid1_EnterCell()
If MSFlexGrid1.Row <> 0 Then
Frm_sub_assignment.txt_id.Text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)
Unload Me
Frm_sub_assignment.txt_id.BackColor = vbWhite
End If
End Sub