- ©«¤l
- 8
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- sp3
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-12-30
- ³Ì«áµn¿ý
- 2012-1-6
|
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "X_ExpRepPol" & "#" '
SQLStr = "SELECT X_ExpRepPol.* FROM X_ExpRepPol "
SQLStr = SQLStr & "WHERE (((X_ExpRepPol.XRPPFTFacNo)='" & FacNo & "') AND ((X_ExpRepPol.XRPCPOName)='²¸®ñ¤Æª«') AND ((Year([XRPSDate]))>=" & WestYS1 & ")) OR (((X_ExpRepPol.XRPPFTFacNo)='" & FacNo & "') AND ((X_ExpRepPol.XRPCPOName)='´á®ñ¤Æª«') AND ((Year([XRPSDate]))>=" & WestYS1 & "))"
Call GetDataFromDB(lsExpDBFilePathName, SQLStr, EmptyRowIndex + 1, "Yes")
'
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "X_ExpCtl" & "#" '
SQLStr = "SELECT X_ExpCtl.* FROM X_ExpCtl WHERE (((X_ExpCtl.XECPFTFacNo)='" & FacNo & "') AND ((Year([XECSDate]))>=" & WestYS1 & "))"
Call GetDataFromDB(lsExpDBFilePathName, SQLStr, EmptyRowIndex + 1, "Yes")
'
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "X_ExpCtlPol" & "#" '
SQLStr = "SELECT X_ExpCtlPol.* FROM X_ExpCtlPol WHERE (((X_ExpCtlPol.XCPPFTFacNo)='" & FacNo & "') AND ((X_ExpCtlPol.XCPCPOName)='²¸®ñ¤Æª«') AND ((Year([XCPSDate]))>=" & WestYS1 & ")) OR (((X_ExpCtlPol.XCPPFTFacNo)='" & FacNo & "') AND ((X_ExpCtlPol.XCPCPOName)='´á®ñ¤Æª«') AND ((Year([XCPSDate]))>=" & WestYS1 & "))"
Call GetDataFromDB(lsExpDBFilePathName, SQLStr, EmptyRowIndex + 1, "Yes")
'
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "X_ExpRepReq" & "#" '
SQLStr = "SELECT X_ExpRepReq.* "
SQLStr = SQLStr & "FROM X_ExpRep LEFT JOIN X_ExpRepReq ON (X_ExpRep.XERMEREquipNo = X_ExpRepReq.XRRMEREquipNoP) AND (X_ExpRep.XERFlag = X_ExpRepReq.XRRFlag) AND (X_ExpRep.XERPosition = X_ExpRepReq.XRRPosition) AND (X_ExpRep.XEROrder = X_ExpRepReq.XRROrder) AND (X_ExpRep.XERSDate = X_ExpRepReq.XRRSDate) AND (X_ExpRep.XERPFTFacNo = X_ExpRepReq.XRRPFTFacNo) "
SQLStr = SQLStr & "WHERE (((X_ExpRepReq.XRRSn) Is Not Null) AND ((Year([XERSDate]))>=" & WestYS1 & ") AND ((X_ExpRep.XERPFTFacNo)='" & FacNo & "') AND ((X_ExpRepReq.XRRKind)<3)) "
SQLStr = SQLStr & "ORDER BY X_ExpRep.XERMEREquipNo, X_ExpRep.XERSDate, X_ExpRep.XEROrder, X_ExpRepReq.XRRSn"
Call GetDataFromDB(lsExpDBFilePathName, SQLStr, EmptyRowIndex + 1, "Yes")
'
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "X_ExpRepAgt" & "#" '
SQLStr = "SELECT X_ExpRepAgt.* "
SQLStr = SQLStr & "FROM X_ExpRep LEFT JOIN X_ExpRepAgt ON (X_ExpRep.XERFlag = X_ExpRepAgt.XRAFlag) AND (X_ExpRep.XERPosition = X_ExpRepAgt.XRAPosition) AND (X_ExpRep.XEROrder = X_ExpRepAgt.XRAOrder) AND (X_ExpRep.XERSDate = X_ExpRepAgt.XRASDate) AND (X_ExpRep.XERMEREquipNo = X_ExpRepAgt.XRAMEREquipNoP) AND (X_ExpRep.XERPFTFacNo = X_ExpRepAgt.XRAPFTFacNo) "
SQLStr = SQLStr & "WHERE (((X_ExpRepAgt.XRASn) Is Not Null) AND ((X_ExpRep.XERPFTFacNo)='" & FacNo & "') AND (Year([XERSDate])>2002)) "
SQLStr = SQLStr & "ORDER BY X_ExpRepAgt.XRASn"
Call GetDataFromDB(lsExpDBFilePathName, SQLStr, EmptyRowIndex + 1, "No")
'
EmptyRowIndex = GetEmptyRowIndex("¶×¤J")
Cells(EmptyRowIndex, 3).Value = "#" & "End" & "#"
'----------------------------------------------------¨D¨úP_FactoryStartRowNbr,P_FactoryCount,P_FactoryFieldCount
Call GetIndex("¶×¤J", "P_Factory")
If CLng(YS_Y) <= 95 Then '95¦~¶×¤J¥\¯à
Call GetIndex("¶×¤J", "P_Exp")
Call GetIndex("¶×¤J", "P_Exp_Pipe_0")
Call GetIndex("¶×¤J", "P_Exp_Pipe_1")
Else
Call GetIndex("¶×¤J", "applyusersend")
Call GetIndex("¶×¤J", "chimneyapply")
End If
Call GetIndex("¶×¤J", "X_ExpRep")
Call GetIndex("¶×¤J", "X_ExpRepPol")
Call GetIndex("¶×¤J", "X_ExpCtl")
Call GetIndex("¶×¤J", "X_ExpCtlPol")
Call GetIndex("¶×¤J", "X_ExpRepReq")
Call GetIndex("¶×¤J", "X_ExpRepAgt")
Call GetIndex("¶×¤J", "End")
'
If P_FactoryCount = 0 Then
MsgBox "¦bP_Factory¤¤,§ä¤£¨ì¸ê®Æ,µLªkÄ~Äò°õ¦æ"
Exit Sub
End If
If P_FactoryCount > 1 Then
MsgBox "¦bP_Factory¤¤,¸ê®Æ¤j©ó1µ§,µLªkÄ~Äò°õ¦æ"
Exit Sub
End If
'°t¦X961©u×¥¿
'If P_ExpCount = 0 Then
'MsgBox "¦bP_Exp¤¤,§ä¤£¨ì¸ê®Æ,µLªkÄ~Äò°õ¦æ"
'Exit Sub
'End If
'If P_Exp_Pipe_0Count = 0 Then
'MsgBox "¦b¥Ó³ø¤¤,§ä¤£¨ì¸ê®Æ,µLªkÄ~Äò°õ¦æ"
'Exit Sub
'End If
'§ï¦¨µLªì¼f¸ê®Æ¤]¥i¼f¬d
'If P_Exp_Pipe_1Count = 0 Then
'MsgBox "¦bªì¼f¤¤,§ä¤£¨ì¸ê®Æ,µLªkÄ~Äò°õ¦æ"
'Exit Sub
'End If
'----------------------------------------------------¶ñ¤J¸ê®Æ
Call Filldata
'----------------------------------------------------
'
ActiveWorkbook.Save '¦sÀÉ
End Sub
-----------------------------------------------------------------------§Ú¬O¤À¹j½u--------
«ô°U¦U¦ì¤j¤j¡A¨D¸Ñ¬°¦ó§Ú¿é¤J¬O99¦~®É¡A¦sÀɪº«¬ºA¬OÀɦW_099X¡A¨ä¤¤X¬O¤À¬°4©u¡A¦ý·í§Ú¬O¿é¤J100¦~®É¡A¦sÀÉ«o¬OÀɦW_010¡AµLªkÅã¥Ü©u§O¡C
YS = YS_Y & " ¦~ " & YS_S
YS_Y ¬°¦~«×©u§O¡BYS_S ¬°©u§O
¥ýÁÂÁ¦U¦ì!! ÁÂÁ¤j®a |
|