-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule2.bas
More file actions
87 lines (71 loc) · 2.13 KB
/
Module2.bas
File metadata and controls
87 lines (71 loc) · 2.13 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
Attribute VB_Name = "Module2"
Sub toolbar()
Dim mytoolbar As CommandBar 'create custom toolbar
Set mytoolbar = CommandBars.Add("Compliance")
With mytoolbar
.Position = msoBarFloating
.Visible = True
End With
'add buttons & Macros
Dim hs As CommandBarControl, fire As CommandBarControl
Dim cust As CommandBarControl, infect As CommandBarControl
Dim food As CommandBarControl, hsp As CommandBarControl, bfsp As CommandBarControl
Dim te As CommandBarControl, snf As CommandBarControl
Set te = mytoolbar.Controls.Add(Type:=msoControlButton)
With te
.FaceId = 1849
.OnAction = "showform"
.TooltipText = "Search"
End With
Set snf = mytoolbar.Controls.Add(Type:=msoControlButton)
With snf
.FaceId = 505
.OnAction = "shownewform"
.TooltipText = "New Entry"
End With
Set hs = mytoolbar.Controls.Add(Type:=msoControlButton)
With hs
.FaceId = 463
.OnAction = "HealthSafety"
.TooltipText = "Health & Safety"
End With
Set fire = mytoolbar.Controls.Add(Type:=msoControlButton)
With fire
.FaceId = 2151
.OnAction = "fire"
.TooltipText = "Fire"
End With
Set cust = mytoolbar.Controls.Add(Type:=msoControlButton)
With cust
.FaceId = 2148
.OnAction = "CustomerService"
.TooltipText = "Customer Service"
End With
Set food = mytoolbar.Controls.Add(Type:=msoControlButton)
With food
.FaceId = 3205
.OnAction = "FoodHygiene"
.TooltipText = "Food Hygiene"
End With
Set infect = mytoolbar.Controls.Add(Type:=msoControlButton)
With infect
.FaceId = 3202
.OnAction = "InfectionControl"
.TooltipText = "Infection Control"
End With
Set hsp = mytoolbar.Controls.Add(Type:=msoControlButton)
With hsp
.FaceId = 565
.OnAction = "HSP"
.TooltipText = "Health & Safety Passport"
End With
Set bfsp = mytoolbar.Controls.Add(Type:=msoControlButton)
With bfsp
.FaceId = 1672
.OnAction = "BFSP"
.TooltipText = "Food Passport"
End With
End Sub
Sub toolbarclose()
Application.CommandBars("Compliance").Delete
End Sub