-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm_DemobilizeForm.cls
74 lines (66 loc) · 2.86 KB
/
Form_DemobilizeForm.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
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Form_DemobilizeForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Figure out what to do about MarkArrival.
Private Sub btnDemobilizeResources_Click()
Dim strONumbers() As String
Dim strENumbers() As String
Dim strONumberEntry As String
Dim strENumberEntry As String
' TO DO: If most recent StagingAction is NOT In Staging, make sure to Check the resource in.
' If form is blank, display error
If IsNull(Form_DemobilizeForm.txtONumberEntry.Value) And IsNull(Form_DemobilizeForm.txtENumberEntry.Value) Then
msgNoResource = MsgBox("You did not enter any resources. Keep trying!", vbInformation, "Resource Demobilization")
' If form is not blank:
Else
' If Personnel are present
If Not IsNull(Form_DemobilizeForm.txtONumberEntry.Value) Then
strONumberEntry = Trim(CStr(Form_DemobilizeForm.txtONumberEntry.Value))
strONumbers = Split(strONumberEntry, vbCrLf)
Call Demobilize(strONumbers)
End If
' If Equipment is present
If Not IsNull(Form_DemobilizeForm.txtENumberEntry.Value) Then
strENumberEntry = Trim(CStr(Form_DemobilizeForm.txtENumberEntry.Value))
strENumbers = Split(strENumberEntry, vbCrLf)
Call Demobilize(, strENumbers)
End If
msgConfirmation = MsgBox("The resources have been demobilized.", vbInformation, "Resource Demobilization")
'Open StagingAreaMainMenu
DoCmd.OpenForm "StagingAreaMainMenu"
'Close MobilizeForm
DoCmd.Close acForm, "DemobilizeForm"
End If
End Sub
Private Sub btnDemobilizeUnit_Click()
'CNumberEntry =
'Get resources from specified unit, then:
Dim OArray() As String
Dim EArray() As String
EString = Form_DemobilizeForm.txtENumberEntry.Value
OString = Form_DemobilizeForm.txtONumberEntry.Value
'If most recent StagingAction is NOT In Staging, make sure to Check the resource in.
If IsNull(OString) And IsNull(EString) Then
NoResourceMessage = MsgBox("You did not enter any resources.", vbInformation, "Resource Demobilization")
Else
If Not IsNull(OString) Then
OArray = Split(OString, vbCrLf)
Call Demobilize(OArray)
End If
If Not IsNull(EString) Then
EArray = Split(EString, vbCrLf)
Call Demobilize(, EArray)
End If
demobilizationConfirmation = MsgBox("The resources have been demobilized.", vbInformation, "Resource Demobilization")
End If
'Open StagingAreaMainMenu
DoCmd.OpenForm "StagingAreaMainMenu"
'Close MobilizeForm
DoCmd.Close acForm, "DemobilizeForm"
End Sub