-
Notifications
You must be signed in to change notification settings - Fork 0
/
OfrmAccountProfile.frm
1137 lines (1111 loc) · 36 KB
/
OfrmAccountProfile.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
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
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form OfrmAccountProfile
BorderStyle = 1 'Fixed Single
Caption = "Accounts"
ClientHeight = 7935
ClientLeft = 3930
ClientTop = 1965
ClientWidth = 7350
Icon = "OfrmAccountProfile.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MousePointer = 99 'Custom
ScaleHeight = 7935
ScaleWidth = 7350
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox ctrlLiner1
Height = 30
Left = 0
ScaleHeight = 30
ScaleWidth = 7575
TabIndex = 44
Top = 840
Width = 7575
End
Begin VB.Frame Frame7
Caption = "ID Count"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3120
TabIndex = 41
Top = 1800
Width = 1095
Begin VB.Label lblCount
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "0"
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 210
Left = 480
TabIndex = 43
Top = 240
Width = 120
End
Begin VB.Label Label13
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "0000"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 1620
TabIndex = 42
Top = 280
Width = 420
End
End
Begin MSComDlg.CommonDialog dlgPic
Left = 6600
Top = 1800
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.Frame Frame6
Caption = "PC NAME"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 120
TabIndex = 37
Top = 960
Width = 1815
Begin VB.Label lblPcId
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "PC ID"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 1050
TabIndex = 39
Top = 285
Width = 450
End
Begin VB.Label Label7
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "0000"
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 210
Left = 3240
TabIndex = 38
Top = 240
Width = 480
End
End
Begin VB.Frame Frame3
Caption = "User ID"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2040
TabIndex = 32
Top = 960
Width = 2175
Begin VB.Label lblId
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "0000"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 1620
TabIndex = 33
Top = 280
Width = 420
End
End
Begin VB.Frame Frame2
Caption = "Employee Profile"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 120
TabIndex = 16
Top = 5640
Width = 7095
Begin VB.ComboBox cboEmpStatus
Height = 315
ItemData = "OfrmAccountProfile.frx":038A
Left = 1680
List = "OfrmAccountProfile.frx":0397
Style = 2 'Dropdown List
TabIndex = 13
Top = 960
Width = 1575
End
Begin VB.ComboBox cboPosition
Height = 315
ItemData = "OfrmAccountProfile.frx":03B9
Left = 5040
List = "OfrmAccountProfile.frx":03C0
Style = 2 'Dropdown List
TabIndex = 14
Top = 480
Width = 1815
End
Begin VB.ComboBox cboRemarks
Height = 315
ItemData = "OfrmAccountProfile.frx":03CC
Left = 5040
List = "OfrmAccountProfile.frx":03D6
Style = 2 'Dropdown List
TabIndex = 15
Top = 960
Width = 1815
End
Begin MSComCtl2.DTPicker dtpDHired
BeginProperty DataFormat
Type = 0
Format = "dd-mmm-yy"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 315
Left = 2760
TabIndex = 12
Top = 480
Width = 255
_ExtentX = 450
_ExtentY = 556
_Version = 393216
Format = 81920003
CurrentDate = 40071
End
Begin MSMask.MaskEdBox txtDhired
Height = 285
Left = 1680
TabIndex = 11
Top = 480
Width = 1095
_ExtentX = 1931
_ExtentY = 503
_Version = 393216
MaxLength = 10
Mask = "##/##/####"
PromptChar = " "
End
Begin VB.Label lblEmpStatus
AutoSize = -1 'True
Caption = "* Emp. Stat.:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 31
Top = 960
Width = 1050
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "* Position:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3720
TabIndex = 28
Top = 480
Width = 870
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "* Date Hired:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 27
Top = 480
Width = 1095
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "* Remarks:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3720
TabIndex = 26
Top = 960
Width = 960
End
End
Begin VB.Frame Frame1
Caption = "Personal Profile"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3015
Left = 120
TabIndex = 17
Top = 2520
Width = 7095
Begin VB.TextBox txtContact
BeginProperty DataFormat
Type = 0
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 285
Left = 5040
TabIndex = 10
Top = 2400
Width = 1815
End
Begin VB.ComboBox cboStatus
Height = 315
ItemData = "OfrmAccountProfile.frx":03EE
Left = 5040
List = "OfrmAccountProfile.frx":03F8
Style = 2 'Dropdown List
TabIndex = 9
Top = 1920
Width = 1815
End
Begin VB.ComboBox cboGender
Height = 315
ItemData = "OfrmAccountProfile.frx":040D
Left = 5040
List = "OfrmAccountProfile.frx":041A
Style = 2 'Dropdown List
TabIndex = 8
Top = 1440
Width = 1215
End
Begin VB.TextBox txtAge
Alignment = 1 'Right Justify
BeginProperty DataFormat
Type = 0
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 285
Left = 1680
Locked = -1 'True
MaxLength = 2
TabIndex = 6
Top = 2400
Width = 375
End
Begin VB.TextBox txtLname
BeginProperty DataFormat
Type = 0
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 285
Left = 1680
TabIndex = 3
Top = 1440
Width = 1575
End
Begin VB.TextBox txtFname
BeginProperty DataFormat
Type = 0
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 285
Left = 1680
TabIndex = 1
Top = 480
Width = 1575
End
Begin VB.TextBox txtMname
BeginProperty DataFormat
Type = 0
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 285
Left = 1680
TabIndex = 2
Top = 960
Width = 1575
End
Begin VB.TextBox txtAddress
Height = 735
Left = 5040
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 7
Top = 480
Width = 1815
End
Begin MSComCtl2.DTPicker dtpBdate
BeginProperty DataFormat
Type = 0
Format = "dd-mmm-yy"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 0
EndProperty
Height = 315
Left = 2760
TabIndex = 5
Top = 1920
Width = 255
_ExtentX = 450
_ExtentY = 556
_Version = 393216
Format = 81920003
CurrentDate = 40071
End
Begin MSMask.MaskEdBox txtBdate
Height = 285
Left = 1680
TabIndex = 4
Top = 1920
Width = 1095
_ExtentX = 1931
_ExtentY = 503
_Version = 393216
MaxLength = 10
Mask = "##/##/####"
PromptChar = " "
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "Status:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3720
TabIndex = 30
Top = 1920
Width = 600
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "* Birth Date:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 25
Top = 1920
Width = 1050
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "* Gender:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3600
TabIndex = 24
Top = 1440
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "* Age:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 23
Top = 2400
Width = 525
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "* Surname:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 22
Top = 1440
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "* Middle Name:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 21
Top = 960
Width = 1275
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "* First Name:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 20
Top = 480
Width = 1095
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "* Address:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3600
TabIndex = 19
Top = 480
Width = 885
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "Contact #:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 3720
TabIndex = 18
Top = 2400
Width = 885
End
End
Begin VB.Frame Frame4
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 120
TabIndex = 34
Top = 1800
Width = 2895
Begin VB.TextBox txtSrchStr
BeginProperty DataFormat
Type = 1
Format = """Php""#,##0.00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 13321
SubFormatType = 2
EndProperty
ForeColor = &H8000000B&
Height = 300
Left = 720
TabIndex = 0
Text = "Search"
Top = 200
Width = 1695
End
Begin VB.Label Label17
AutoSize = -1 'True
Caption = "ID:"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 240
TabIndex = 35
Top = 240
Width = 240
End
Begin VB.Image Image2
Height = 480
Left = 2400
Picture = "OfrmAccountProfile.frx":0434
Top = 100
Width = 480
End
End
Begin VB.Frame Frame5
Caption = "Profile Picture"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1455
Left = 4320
TabIndex = 36
Top = 960
Width = 2895
Begin VB.Shape Shape1
BorderColor = &H80000011&
FillColor = &H80000004&
Height = 1095
Left = 1440
Top = 240
Width = 1335
End
Begin VB.Image imgProfile
Height = 1095
Left = 1440
Stretch = -1 'True
Top = 240
Width = 1335
End
Begin VB.Label Label16
AutoSize = -1 'True
Caption = "NO IMAGE"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 1680
TabIndex = 40
Top = 720
Width = 825
End
End
Begin VB.CommandButton cmdSave
Caption = "&Save"
Height = 375
Left = 3000
TabIndex = 45
Top = 7440
Width = 1335
End
Begin VB.Label Label15
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "* Required field"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 195
Left = 480
TabIndex = 29
Top = 7560
Width = 1125
End
Begin VB.Image Image1
Height = 480
Left = 0
Picture = "OfrmAccountProfile.frx":0CFE
Top = 7425
Width = 480
End
End
Attribute VB_Name = "OfrmAccountProfile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdBrowse_Click()
On Error GoTo InvldPic
dlgPic.DialogTitle = "Load Profile Image"
dlgPic.InitDir = "My Documents"
dlgPic.filter = "Jepeg Image (*.jpg;*.jpeg)|*.jpg;*.jpeg|Bitmap Image (*.bmp)|*.bmp|All Files (*.*)|*.*"
dlgPic.ShowOpen
If dlgPic.FileName = "" Then
Exit Sub
End If
imgProfile.Picture = LoadPicture(dlgPic.FileName)
ImgName = dlgPic.FileTitle
ImgSrc = dlgPic.FileName
Exit Sub
InvldPic:
MsgBox "It is not a valid picture", vbExclamation
End Sub
Private Sub cmdDelete_Click()
'locate a user id and delete if found
ExecuteSql "Select * from tblAccountProfile where id = '" & lblId.Caption & "'"
With rs
'if no record...
If .EOF Then
MsgBox "No specified account to delete. Please search for an account", vbInformation
ClrFlds
txtSrchStr.SetFocus
Else
'else if a record found
'test if the image is not empty then delete from accounts images
If imgProfile.Picture <> LoadPicture() Then
Me.MousePointer = 11
Kill App.Path & "\Images\accounts\" & .Fields!image_name
End If
'delete the account
.Delete
'clear all
ClrFlds
MsgBox "Account id " & lblId.Caption & " has been deleted", vbInformation
End If
End With
'test if there is no account left in the database, then exit system
ExecuteSql "Select * from tblAccountProfile"
If rs.RecordCount = 0 Then
MsgBox "All accounts has been deleted. The system will now exit", vbCritical
'exit
End
End If
End Sub
Private Sub cmdRemove_Click()
imgProfile.Picture = LoadPicture()
ImgName = Empty
End Sub
Private Sub cmdSave_Click()
Dim msg As String
'set functions in trappings
If TextBoxEmpty(txtFname) Then Exit Sub
If TextBoxEmpty(txtMname) Then Exit Sub
If TextBoxEmpty(txtLname) Then Exit Sub
If ComboEmpty(cboGender) Then Exit Sub
If TextBoxEmpty(txtBdate) Then Exit Sub: SelectAll (txtBdate)
If TextBoxEmpty(txtAddress) Then Exit Sub
If TextBoxEmpty(txtDhired) Then Exit Sub
If ComboEmpty(ComboEmptyStatus) Then Exit Sub
If ComboEmpty(cboPosition) Then Exit Sub
'select an specified account
ExecuteSql "Select * from tblAccountProfile where id = '" & lblId.Caption & "'"
With rs
'if a command button is Save then add new record
'else update the record
If cmdSave.Caption <> "&Update" Then
msg = "Account id " & lblId.Caption & " has been successfully added."
.AddNew
.Fields!account_no = Val(RcrdId("tblAccountProfile", , "account_no"))
If ImgName <> Empty Then
FileCopy ImgSrc, App.Path & "\Images\Accounts\" & ImgName
End If
Else
If ImgName <> Empty And .Fields!image_name = Empty Then
FileCopy ImgSrc, App.Path & "\Images\Accounts\" & ImgName
End If
If .Fields!image_name <> Empty And .Fields!image_name <> ImgName Then
Kill App.Path & "\Images\Accounts\" & .Fields!image_name
If ImgName <> Empty Then
FileCopy ImgSrc, App.Path & "\Images\Accounts\" & ImgName
End If
End If
msg = "Account id " & lblId.Caption & " has been successfully updated."
End If
Me.MousePointer = 11
.Fields!id = lblId.Caption
.Fields!fname = txtFname.Text
.Fields!mname = txtMname.Text
.Fields!lname = txtLname.Text
.Fields!age = Val(txtAge)
.Fields!gender = cboGender.Text
.Fields!bdate = txtBdate.Text
.Fields!address = txtAddress.Text
.Fields!Status = cboStatus.Text
.Fields!contact = Val(txtContact)
.Fields!date_hired = txtDhired.Text
.Fields!Position = cboPosition.Text
.Fields!remarks = cboRemarks.Text
.Fields!emp_status = ComboEmptyStatus.Text
.Fields!image_name = ImgName
.Fields!date_reg = Format(Date, "mm/dd/yyyy")
.Update
i = MsgBox(msg & " Do you want to set the security of this Account?", vbQuestion + vbYesNo)
If i = vbYes Then
frmAcntManage.Show vbModal
End If
ClrFlds
End With
If CurrentUserAdmin Then
Unload Me
End If
End Sub
Private Sub cmdSecurity_Click()
'show security manager and set security accounts
ExecuteSql "Select * from tblAccountProfile where id = '" & lblId.Caption & "'"
If rs.EOF = False Then
frmAcntManage.txtId = lblId.Caption
frmAcntManage.Show vbModal
Else
frmAcntManage.Show vbModal
End If
End Sub
Private Sub dtpBdate_Change()
'format txtbdate as short date
txtBdate.Text = Format(dtpBdate.value, "mm/dd/yyyy")
End Sub
Private Sub dtpBdate_LostFocus()
'if age is below zero, invalid bdate
If Val(txtAge.Text) <= 10 Then
MsgBox "Invalid date: Birth date must be less than current date", vbExclamation
txtBdate.Text = " / / "
txtAge.Text = Empty
End If
End Sub
Private Sub dtpDHired_Change()
'change format to short date
txtDhired.Text = Format(dtpDHired.value, "mm/dd/yyyy")
End Sub
Private Sub Form_Load()
'pc name
''lblPcId.Caption = PcId
ClrFlds
'add the saved postions from database
ExecuteSql "Select * from tblAccountPosition"
While Not rs.EOF
cboPosition.AddItem (rs.Fields!Description)
rs.MoveNext
Wend
ExecuteSql "Select* from tblAccountProfile"
lblCount.Caption = rs.RecordCount
lblId.Caption = RcrdId("tblAccountProfile", "NEW-", "account_no")
End Sub
Public Sub ClrFlds()
'clear all
Me.MousePointer = 0