-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewentry2.frm
More file actions
156 lines (133 loc) · 5.48 KB
/
newentry2.frm
File metadata and controls
156 lines (133 loc) · 5.48 KB
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
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} newentry
Caption = "New Entry"
ClientHeight = 3975
ClientLeft = 45
ClientTop = 435
ClientWidth = 6570
OleObjectBlob = "newentry2.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "newentry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub okbutton_Click()
Dim x As Integer, fn As String, sn As String, dept As String, gl As String, gldate As Date
If Cells(3, 1) <> "" Then
ActiveSheet.Range("a2").End(xlDown).Select
x = ActiveCell.Row + 1
ActiveSheet.Cells(x, 1).Value = newentry.fn.Value
ActiveSheet.Cells(x, 2).Value = newentry.sn.Value
ActiveSheet.Cells(x, 3).Value = newentry.dept.Value
ActiveSheet.Cells(x, 4).Value = newentry.gl.Value
ActiveSheet.Cells(x, 5).Value = newentry.gldate.Value
ActiveSheet.Cells(x, 5) = Format(ActiveSheet.Cells(x, 5), "dd/mm/yy")
If ActiveSheet.Cells(x, 4).Value = "N" Then ActiveSheet.Cells(x, 5).Interior.ColorIndex = 15
If Cells(x, 4).Value = "Y" And Cells(x, 5) = "" Then Cells(x, 5).Interior.ColorIndex = 6
If Cells(x, 4).Value = "Y" Then
Cells(x, 6).Value = newentry.gldate.Value
Cells(x, 6) = Format(Cells(x, 6), "dd/mm/yy")
Cells(x, 7).Value = newentry.gldate.Value
Cells(x, 7) = Format(Cells(x, 7), "dd/mm/yy")
Cells(x, 8).Value = newentry.gldate.Value
Cells(x, 8) = Format(Cells(x, 8), "dd/mm/yy")
Cells(x, 9).Value = newentry.gldate.Value
Cells(x, 9) = Format(Cells(x, 9), "dd/mm/yy")
Cells(x, 6).Interior.ColorIndex = 15
Cells(x, 7).Interior.ColorIndex = 15
Cells(x, 8).Interior.ColorIndex = 15
Cells(x, 9).Interior.ColorIndex = 15
End If
Else
ActiveSheet.Cells(3, 1).Value = newentry.fn.Value
ActiveSheet.Cells(3, 2).Value = newentry.sn.Value
ActiveSheet.Cells(3, 3).Value = newentry.dept.Value
ActiveSheet.Cells(3, 4).Value = newentry.gl.Value
ActiveSheet.Cells(3, 5).Value = newentry.gldate.Value
ActiveSheet.Cells(3, 5) = Format(ActiveSheet.Cells(3, 5), "dd/mm/yy")
If ActiveSheet.Cells(3, 4).Value = "N" Then ActiveSheet.Cells(3, 5).Interior.ColorIndex = 15
If Cells(3, 4).Value = "Y" And Cells(3, 5) = "" Then Cells(3, 5).Interior.ColorIndex = 6
If Cells(3, 4).Value = "Y" Then
Cells(3, 6).Value = newentry.gldate.Value
Cells(3, 6) = Format(Cells(3, 6), "dd/mm/yy")
Cells(3, 7).Value = newentry.gldate.Value
Cells(3, 7) = Format(Cells(3, 7), "dd/mm/yy")
Cells(3, 8).Value = newentry.gldate.Value
Cells(3, 8) = Format(Cells(3, 8), "dd/mm/yy")
Cells(3, 9).Value = newentry.gldate.Value
Cells(3, 9) = Format(Cells(3, 9), "dd/mm/yy")
Cells(3, 6).Interior.ColorIndex = 15
Cells(3, 7).Interior.ColorIndex = 15
Cells(3, 8).Interior.ColorIndex = 15
Cells(3, 9).Interior.ColorIndex = 15
End If
End If
Unload Me
End Sub
Private Sub submitbutton_Click()
Dim x As Integer, fn As String, sn As String, dept As String, gl As String, gldate As Date
If ActiveSheet.Cells(3, 1) <> "" Then
ActiveSheet.Range("a2").End(xlDown).Select
x = ActiveCell.Row + 1
ActiveSheet.Cells(x, 1).Value = newentry.fn.Value
ActiveSheet.Cells(x, 2).Value = newentry.sn.Value
ActiveSheet.Cells(x, 3).Value = newentry.dept.Value
ActiveSheet.Cells(x, 4).Value = newentry.gl.Value
ActiveSheet.Cells(x, 5).Value = newentry.gldate.Value
ActiveSheet.Cells(x, 5) = Format(ActiveSheet.Cells(x, 5), "dd/mm/yy")
If ActiveSheet.Cells(x, 4).Value = "N" Then ActiveSheet.Cells(x, 5).Interior.ColorIndex = 15
If Cells(x, 4).Value = "Y" And Cells(x, 5) = "" Then Cells(x, 5).Interior.ColorIndex = 6
If Cells(x, 4).Value = "Y" Then
Cells(x, 6).Value = newentry.gldate.Value
Cells(x, 6) = Format(Cells(x, 6), "dd/mm/yy")
Cells(x, 7).Value = newentry.gldate.Value
Cells(x, 7) = Format(Cells(x, 7), "dd/mm/yy")
Cells(x, 8).Value = newentry.gldate.Value
Cells(x, 8) = Format(Cells(x, 8), "dd/mm/yy")
Cells(x, 9).Value = newentry.gldate.Value
Cells(x, 9) = Format(Cells(x, 9), "dd/mm/yy")
Cells(x, 6).Interior.ColorIndex = 15
Cells(x, 7).Interior.ColorIndex = 15
Cells(x, 8).Interior.ColorIndex = 15
Cells(x, 9).Interior.ColorIndex = 15
End If
newentry.fn.Value = ""
newentry.sn.Value = ""
newentry.dept.Value = ""
newentry.gl.Value = ""
newentry.gldate.Value = ""
Else
ActiveSheet.Cells(3, 1).Value = newentry.fn.Value
ActiveSheet.Cells(3, 2).Value = newentry.sn.Value
ActiveSheet.Cells(3, 3).Value = newentry.dept.Value
ActiveSheet.Cells(3, 4).Value = newentry.gl.Value
ActiveSheet.Cells(3, 5).Value = newentry.gldate.Value
ActiveSheet.Cells(3, 5) = Format(ActiveSheet.Cells(3, 5), "dd/mm/yy")
If ActiveSheet.Cells(3, 4).Value = "N" Then ActiveSheet.Cells(3, 5).Interior.ColorIndex = 15
If Cells(3, 4).Value = "Y" And Cells(3, 5) = "" Then Cells(3, 5).Interior.ColorIndex = 6
If Cells(3, 4).Value = "Y" Then
Cells(3, 6).Value = newentry.gldate.Value
Cells(3, 6) = Format(Cells(3, 6), "dd/mm/yy")
Cells(3, 7).Value = newentry.gldate.Value
Cells(3, 7) = Format(Cells(3, 7), "dd/mm/yy")
Cells(3, 8).Value = newentry.gldate.Value
Cells(3, 8) = Format(Cells(3, 8), "dd/mm/yy")
Cells(3, 9).Value = newentry.gldate.Value
Cells(3, 9) = Format(Cells(3, 9), "dd/mm/yy")
Cells(3, 6).Interior.ColorIndex = 15
Cells(3, 7).Interior.ColorIndex = 15
Cells(3, 8).Interior.ColorIndex = 15
Cells(3, 9).Interior.ColorIndex = 15
End If
newentry.fn.Value = ""
newentry.sn.Value = ""
newentry.dept.Value = ""
newentry.gl.Value = ""
newentry.gldate.Value = ""
End If
End Sub
Private Sub Cancelbutton_Click()
Unload Me
End Sub