-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm_frmOutput1.cls
184 lines (148 loc) · 5.64 KB
/
Form_frmOutput1.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
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "Form_frmOutput1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Compare Database
'#-----------------------------------------------------------------
'#プロシージャ名 :funCheckInput
'#説明 :入力チェック
'#引数 :pstrPath: テンプレートパス
'#戻り値 :True:正常/False:異常
'#-----------------------------------------------------------------
Private Function funCheckInput(ByRef pstrPath As String) As Boolean
funCheckInput = False
Erase gtApply: ReDim gtApply(0)
With gtApply(0)
'-----------------------------------
'■承認日(From)
'-----------------------------------
.ApprovalYmdF = "" & txtApprovalYmdF.Value
If (Len(.ApprovalYmdF) = 0) Then
Call MsgBox(mdlCommon.funGetMsgW("015"), vbExclamation, Sys_Title)
Exit Function
End If
'-----------------------------------
'■承認日(To)
'-----------------------------------
.ApprovalYmdT = "" & txtApprovalYmdT.Value
If (Len(.ApprovalYmdT) = 0) Then .ApprovalYmdT = .ApprovalYmdF
'-----------------------------------
'■関連チェック
'-----------------------------------
If (.ApprovalYmdF > .ApprovalYmdT) Then
Call MsgBox(mdlCommon.funGetMsgW("016"), vbExclamation, Sys_Title)
Exit Function
End If
'-----------------------------------
'■印刷
'-----------------------------------
.PrintFlg = chkPrint.Value
End With
'-----------------------------------
'■EXCELテンプレートパスチェック
'-----------------------------------
pstrPath = CurrentProject.Path
If (Right$(pstrPath, 1) <> "\") Then pstrPath = pstrPath & "\"
pstrPath = pstrPath & EXCEL_TEMP_PATH
If (Right$(pstrPath, 1) <> "\") Then pstrPath = pstrPath & "\"
'▼EXCELテンプレート存在チェック
If (Len(Dir(pstrPath & EXCEL_TEMP_FILE1)) = 0) Then
'▼存在しない場合
Call MsgBox(mdlCommon.funGetMsgW("018"), vbExclamation, Sys_Title)
Exit Function
End If
funCheckInput = True
End Function
'#-----------------------------------------------------------------
'#プロシージャ名 :cmdCancel_Click
'#説明 :キャンセルボタンクリック時
'#-----------------------------------------------------------------
Private Sub cmdCancel_Click()
'-----------------------------------
'■画面を閉じる
'-----------------------------------
Call DoCmd.Close(acForm, Me.Name)
Call DoCmd.OpenForm("frmMenuOutput")
End Sub
'#-----------------------------------------------------------------
'#プロシージャ名 :cmdOutput_Click
'#説明 :出力ボタンクリック時
'#-----------------------------------------------------------------
Private Sub cmdOutput_Click()
Dim blnRtn As Boolean '戻り値
Dim intRtn As Integer '戻り値
Dim strTemp As String 'テンプレートパス
Dim strOut As String '出力先パス
'-----------------------------------
'■入力チェック
'-----------------------------------
blnRtn = funCheckInput(strTemp)
If (blnRtn = False) Then Exit Sub
'-----------------------------------
'■確認メッセージ
'-----------------------------------
intRtn = MsgBox(mdlCommon.funGetMsgI("005"), vbInformation + vbYesNo, Sys_Title)
If (intRtn = vbNo) Then Exit Sub
'-----------------------------------
'■フォルダ参照ダイアログ表示
'-----------------------------------
strOut = mdlCommon.funFileSaveDialog1(mdlCommon.funGetMsgI("007"))
If (Len(strOut) = 0) Then Exit Sub
If (Right(strOut, 1) <> "\") Then strOut = strOut & "\"
'▼アイコン(待機)
Screen.MousePointer = CST_MP_H
DoEvents
'-----------------------------------
'■家族カード申請書出力
'-----------------------------------
blnRtn = mdlOutput.funOutPutProc1(strTemp, strOut)
If (blnRtn = False) Then GoTo End_Proc
Call MsgBox(mdlCommon.funGetMsgI("006"), vbInformation, Sys_Title)
End_Proc:
'▼アイコン(デフォルト)
Screen.MousePointer = CST_MP_D
End Sub
'#-----------------------------------------------------------------
'#プロシージャ名 :Form_Load
'#説明 :画面起動時
'#-----------------------------------------------------------------
Private Sub Form_Load()
'-----------------------------------
'■初期処理
'-----------------------------------
'▼画面サイズ設定
Call mdlCommon.subGamenSizeCM(12, 9)
chkPrint.Value = CST_CHK_OFF
End Sub
'#-----------------------------------------------------------------
'#プロシージャ名 :txtApprovalYmdF_DblClick
'#説明 :ダブルクリック時
'#-----------------------------------------------------------------
Private Sub txtApprovalYmdF_DblClick(Cancel As Integer)
'-----------------------------------
'■カレンダー表示
'-----------------------------------
Call DoCmd.OpenForm("frmCalender", , , , , acDialog)
If (Len(gstrCalender) > 0) Then
txtApprovalYmdF.Value = gstrCalender
End If
End Sub
'#-----------------------------------------------------------------
'#プロシージャ名 :txtApprovalYmdT_DblClick
'#説明 :ダブルクリック時
'#-----------------------------------------------------------------
Private Sub txtApprovalYmdT_DblClick(Cancel As Integer)
'-----------------------------------
'■カレンダー表示
'-----------------------------------
Call DoCmd.OpenForm("frmCalender", , , , , acDialog)
If (Len(gstrCalender) > 0) Then
txtApprovalYmdT.Value = gstrCalender
End If
End Sub