-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form_frmPUEinstellungenNotenSchueler.cls
491 lines (428 loc) · 17.9 KB
/
Form_frmPUEinstellungenNotenSchueler.cls
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Form_frmPUEinstellungenNotenSchueler"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Compare Database
Option Explicit
Dim StrSchueler As String
Dim strSchuelerName As String
Dim strAnzahlSa1 As String
Dim strAnzahlSa2 As String
Dim strAnzahlSon1 As String
Dim strAnzahlSon2 As String
Dim varSaHj1(0 To 1) As Variant
Dim varSaHj2(0 To 1) As Variant
Dim varSonsHj1(0 To 20) As Variant
Dim varSonsHj2(0 To 20) As Variant
Private booAenderung As Boolean
Private mycolSchuelerdaten As colSchülerNoten
Private myclsKlasseNoten As clsKlasseNoten
Private Sub cmbgew1_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew1_1, 1, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew2_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew2_1, 4, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew3_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew3_1, 7, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew4_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew4_1, 10, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew5_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew5_1, 13, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew6_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew6_1, 16, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew7_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew7_1, 19, 1) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew1_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew1_2, 1, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew2_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew2_2, 4, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew3_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew3_2, 7, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew4_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew4_2, 10, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew5_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew5_2, 13, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew6_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew6_2, 16, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmbgew7_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(cmbgew7_2, 19, 2) Then
booAenderung = True
End If
End Sub
Private Sub cmdAbbrechen_Click()
'Schließen ohne Speichern
On Error GoTo Err_cmdclose_Click
DOCMD.Close acForm, "frmPUEinstellungenNotenSchueler"
Exit_cmdclose_Click:
Exit Sub
Err_cmdclose_Click:
MsgBox Err.Description
Resume Exit_cmdclose_Click
End Sub
Private Sub cmdSpeichern_Click()
' gib die Einstellungen zurück
If booAenderung = True Then
Forms("FrmNotenNachKlassen").RueckgabeAenderungUebernehmen = True
VariablenSetzen
End If
cmdAbbrechen_Click
End Sub
Private Sub Form_Load()
'Höhe und Breite einstellen
Me.InsideHeight = Me.Section(acDetail).Height
Me.InsideWidth = Me.Width
End Sub
Private Sub Form_Open(Cancel As Integer)
Dim strValue As Variant
Dim intCount As Integer
Dim strControl1 As String
Dim strControl2 As String
Dim StrControl3 As String
Dim strcontrol4 As String
Dim strControl5 As String
Dim strControl6 As String
Dim strControl7 As String
Dim intCountSons As Integer
booAenderung = False
Set mycolSchuelerdaten = Forms("FrmNotenNachKlassen").Schuelerdaten
Set myclsKlasseNoten = Forms("FrmNotenNachKlassen").Klassendaten
If Not IsNull(Me.OpenArgs) Then
StrSchueler = Me.OpenArgs
strAnzahlSa1 = myclsKlasseNoten.anz_sa_hj1
strAnzahlSa2 = myclsKlasseNoten.anz_sa_hj2
strAnzahlSon1 = myclsKlasseNoten.anz_son_hj1
strAnzahlSon2 = myclsKlasseNoten.anz_son_hj2
varSaHj1(0) = mycolSchuelerdaten.Item(StrSchueler).dat_sa1_hj1
varSaHj1(1) = mycolSchuelerdaten.Item(StrSchueler).dat_sa2_hj1
varSaHj2(0) = mycolSchuelerdaten.Item(StrSchueler).dat_sa1_hj2
varSaHj2(1) = mycolSchuelerdaten.Item(StrSchueler).dat_sa2_hj2
varSonsHj1(0) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son1_hj1
varSonsHj1(1) = mycolSchuelerdaten.Item(StrSchueler).gew_son1_hj1
varSonsHj1(2) = mycolSchuelerdaten.Item(StrSchueler).dat_son1_hj1
varSonsHj1(3) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son2_hj1
varSonsHj1(4) = mycolSchuelerdaten.Item(StrSchueler).gew_son2_hj1
varSonsHj1(5) = mycolSchuelerdaten.Item(StrSchueler).dat_son2_hj1
varSonsHj1(6) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son3_hj1
varSonsHj1(7) = mycolSchuelerdaten.Item(StrSchueler).gew_son3_hj1
varSonsHj1(8) = mycolSchuelerdaten.Item(StrSchueler).dat_son3_hj1
varSonsHj1(9) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son4_hj1
varSonsHj1(10) = mycolSchuelerdaten.Item(StrSchueler).gew_son4_hj1
varSonsHj1(11) = mycolSchuelerdaten.Item(StrSchueler).dat_son4_hj1
varSonsHj1(12) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son5_hj1
varSonsHj1(13) = mycolSchuelerdaten.Item(StrSchueler).gew_son5_hj1
varSonsHj1(14) = mycolSchuelerdaten.Item(StrSchueler).dat_son5_hj1
varSonsHj1(15) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son6_hj1
varSonsHj1(16) = mycolSchuelerdaten.Item(StrSchueler).gew_son6_hj1
varSonsHj1(17) = mycolSchuelerdaten.Item(StrSchueler).dat_son6_hj1
varSonsHj1(18) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son7_hj1
varSonsHj1(19) = mycolSchuelerdaten.Item(StrSchueler).gew_son7_hj1
varSonsHj1(20) = mycolSchuelerdaten.Item(StrSchueler).dat_son7_hj1
varSonsHj2(0) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son1_hj2
varSonsHj2(1) = mycolSchuelerdaten.Item(StrSchueler).gew_son1_hj2
varSonsHj2(2) = mycolSchuelerdaten.Item(StrSchueler).dat_son1_hj2
varSonsHj2(3) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son2_hj2
varSonsHj2(4) = mycolSchuelerdaten.Item(StrSchueler).gew_son2_hj2
varSonsHj2(5) = mycolSchuelerdaten.Item(StrSchueler).dat_son2_hj2
varSonsHj2(6) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son3_hj2
varSonsHj2(7) = mycolSchuelerdaten.Item(StrSchueler).gew_son3_hj2
varSonsHj2(8) = mycolSchuelerdaten.Item(StrSchueler).dat_son3_hj2
varSonsHj2(9) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son4_hj2
varSonsHj2(10) = mycolSchuelerdaten.Item(StrSchueler).gew_son4_hj2
varSonsHj2(11) = mycolSchuelerdaten.Item(StrSchueler).dat_son4_hj2
varSonsHj2(12) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son5_hj2
varSonsHj2(13) = mycolSchuelerdaten.Item(StrSchueler).gew_son5_hj2
varSonsHj2(14) = mycolSchuelerdaten.Item(StrSchueler).dat_son5_hj2
varSonsHj2(15) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son6_hj2
varSonsHj2(16) = mycolSchuelerdaten.Item(StrSchueler).gew_son6_hj2
varSonsHj2(17) = mycolSchuelerdaten.Item(StrSchueler).dat_son6_hj2
varSonsHj2(18) = mycolSchuelerdaten.Item(StrSchueler).uid_art_son7_hj2
varSonsHj2(19) = mycolSchuelerdaten.Item(StrSchueler).gew_son7_hj2
varSonsHj2(20) = mycolSchuelerdaten.Item(StrSchueler).dat_son7_hj2
strSchuelerName = mycolSchuelerdaten.Item(StrSchueler).nachname & " " & mycolSchuelerdaten.Item(StrSchueler).rufname
Me.Caption = "Einstellungen für den Schüler " & strSchuelerName
Me.txtSchueler = StrSchueler
Me.txtAnzahlSaHj1 = strAnzahlSa1
Me.txtAnzahlSAHj2 = strAnzahlSa2
Me.txtAnzahlSonHj1 = strAnzahlSon1
Me.txtAnzahlSonHj2 = strAnzahlSon2
Me.txtdatumsa1_1 = Nz(varSaHj1(0), "")
Me.txtdatumsa2_1 = Nz(varSaHj1(1), "")
Me.txtdatumsa1_2 = Nz(varSaHj2(0), "")
Me.txtdatumsa2_2 = Nz(varSaHj2(1), "")
intCountSons = 0
For intCount = 1 To strAnzahlSon1
strControl1 = "cmbart" & intCount & "_1"
strControl2 = "cmbgew" & intCount & "_1"
StrControl3 = "txtdatson" & intCount & "_1"
Me.Controls(strControl1).Value = varSonsHj1(intCountSons)
Me.Controls(strControl2).Value = varSonsHj1(intCountSons + 1)
Me.Controls(StrControl3).Value = varSonsHj1(intCountSons + 2)
intCountSons = intCountSons + 3
Next intCount
intCountSons = 0
For intCount = 1 To strAnzahlSon2
strcontrol4 = "cmbart" & intCount & "_2"
strControl5 = "cmbgew" & intCount & "_2"
strControl6 = "txtdatson" & intCount & "_2"
Me.Controls(strcontrol4).Value = varSonsHj2(intCountSons)
Me.Controls(strControl5).Value = varSonsHj2(intCountSons + 1)
Me.Controls(strControl6).Value = varSonsHj2(intCountSons + 2)
intCountSons = intCountSons + 3
Next intCount
Select Case strAnzahlSa1
Case 1
Me.lbldatsa1_1.Visible = True
Me.txtdatumsa1_1.Visible = True
Me.lbldatsa2_1.Visible = False
Me.txtdatumsa2_1.Visible = False
Case 2
Me.lbldatsa1_1.Visible = True
Me.txtdatumsa1_1.Visible = True
Me.lbldatsa2_1.Visible = True
Me.txtdatumsa2_1.Visible = True
Case Else
Me.lbldatsa1_1.Visible = False
Me.txtdatumsa1_1.Visible = False
Me.lbldatsa2_1.Visible = False
Me.txtdatumsa2_1.Visible = False
End Select
Select Case strAnzahlSa2
Case 1
Me.lbldatsa1_2.Visible = True
Me.txtdatumsa1_2.Visible = True
Me.lbldatsa2_2.Visible = False
Me.txtdatumsa2_2.Visible = False
Case 2
Me.lbldatsa1_2.Visible = True
Me.txtdatumsa1_2.Visible = True
Me.lbldatsa2_2.Visible = True
Me.txtdatumsa2_2.Visible = True
Case Else
Me.lbldatsa1_2.Visible = False
Me.txtdatumsa1_2.Visible = False
Me.lbldatsa2_2.Visible = False
Me.txtdatumsa2_2.Visible = False
End Select
For intCount = strAnzahlSon1 + 1 To 7
strControl1 = "lblson" & intCount & "_1"
strControl2 = "lblart" & intCount & "_1"
StrControl3 = "cmbart" & intCount & "_1"
strcontrol4 = "lblgew" & intCount & "_1"
strControl5 = "cmbgew" & intCount & "_1"
strControl6 = "lbldat" & intCount & "_1"
strControl7 = "txtdatson" & intCount & "_1"
Me.Controls(strControl1).Visible = False
Me.Controls(strControl2).Visible = False
Me.Controls(StrControl3).Visible = False
Me.Controls(strcontrol4).Visible = False
Me.Controls(strControl5).Visible = False
Me.Controls(strControl6).Visible = False
Me.Controls(strControl7).Visible = False
Next intCount
For intCount = strAnzahlSon1 + 1 To 7
strControl1 = "lblson" & intCount & "_2"
strControl2 = "lblart" & intCount & "_2"
StrControl3 = "cmbart" & intCount & "_2"
strcontrol4 = "lblgew" & intCount & "_2"
strControl5 = "cmbgew" & intCount & "_2"
strControl6 = "lbldat" & intCount & "_2"
strControl7 = "txtdatson" & intCount & "_2"
Me.Controls(strControl1).Visible = False
Me.Controls(strControl2).Visible = False
Me.Controls(StrControl3).Visible = False
Me.Controls(strcontrol4).Visible = False
Me.Controls(strControl5).Visible = False
Me.Controls(strControl6).Visible = False
Me.Controls(strControl7).Visible = False
Next intCount
End If
End Sub
Public Function CheckGeaendert(ctl As Control, intElement As Integer, intHalbjahr As Integer) As Boolean
' prüft, ob eine Änderung war?
Select Case intHalbjahr
Case 1 '1.Halbjahr Prüfung gegen Variable varSonsHj1
If varSonsHj1(intElement) <> ctl.Value Then
CheckGeaendert = True
Else
CheckGeaendert = False
End If
Case 2 '2.Halbjahr Prüfung gegen Variable varSonsHj2
If varSonsHj2(intElement) <> ctl.Value Then
CheckGeaendert = True
Else
CheckGeaendert = False
End If
End Select
End Function
Public Function CheckGeaendertSa(ctl As Control, intElement As Integer, intHalbjahr As Integer) As Boolean
' prüft, ob eine Änderung war?
Select Case intHalbjahr
Case 1 '1.Halbjahr Prüfung gegen Variable varSaHj1
If varSaHj1(intElement) <> ctl.Value Then
CheckGeaendertSa = True
Else
CheckGeaendertSa = False
End If
Case 2 '2.Halbjahr Prüfung gegen Variable varSaHj2
If varSaHj2(intElement) <> ctl.Value Then
CheckGeaendertSa = True
Else
CheckGeaendertSa = False
End If
End Select
End Function
Private Sub txtdatson1_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson1_1, 2, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson2_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson2_1, 5, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson3_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson3_1, 8, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson4_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson4_1, 11, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson5_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson5_1, 14, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson6_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson6_1, 17, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson7_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson7_1, 20, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson1_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson1_2, 2, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson2_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson2_2, 5, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson3_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson3_2, 8, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson4_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson4_2, 11, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson5_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson5_2, 14, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson6_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson6_2, 17, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatson7_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendert(txtdatson7_2, 20, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatumsa1_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendertSa(txtdatumsa1_1, 0, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatumsa2_1_BeforeUpdate(Cancel As Integer)
If CheckGeaendertSa(txtdatumsa2_1, 1, 1) Then
booAenderung = True
End If
End Sub
Private Sub txtdatumsa1_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendertSa(txtdatumsa1_2, 0, 2) Then
booAenderung = True
End If
End Sub
Private Sub txtdatumsa2_2_BeforeUpdate(Cancel As Integer)
If CheckGeaendertSa(txtdatumsa2_2, 1, 2) Then
booAenderung = True
End If
End Sub
Private Sub VariablenSetzen()
' schreibe die Änderungen in die Schülerdaten
Dim intCount As Integer
Dim strControl1 As String
Dim strControl2 As String
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSchulaufgabenHj1(0) = Nz(Me.txtdatumsa1_1, "")
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSchulaufgabenHj1(1) = Nz(Me.txtdatumsa2_1, "")
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSchulaufgabenHj2(0) = Nz(Me.txtdatumsa1_2, "")
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSchulaufgabenHj2(1) = Nz(Me.txtdatumsa2_2, "")
For intCount = 1 To strAnzahlSon1
strControl1 = "cmbgew" & intCount & "_1"
strControl2 = "txtdatson" & intCount & "_1"
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSonstigeGewHj1(intCount - 1) = Me.Controls(strControl1).Value
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSonstigeDatHj1(intCount - 1) = Nz(Me.Controls(strControl2).Value, "")
Next intCount
For intCount = 1 To strAnzahlSon2
strControl1 = "cmbgew" & intCount & "_2"
strControl2 = "txtdatson" & intCount & "_2"
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSonstigeGewHj2(intCount - 1) = Me.Controls(strControl1).Value
Forms("FrmNotenNachKlassen").RueckgabeSchuelerdatenSonstigeDatHj2(intCount - 1) = Nz(Me.Controls(strControl2).Value, "")
Next intCount
End Sub