📄 frmproductionman.frm
字号:
Caption = "供應商"
Height = 315
Left = 5580
TabIndex = 27
Top = 240
Width = 915
End
Begin VB.Label Label4
BackColor = &H00FFFFFF&
Caption = "交期"
Height = 315
Left = 1020
TabIndex = 26
Top = 2520
Width = 915
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "煮漂"
Height = 255
Left = 1020
TabIndex = 25
Top = 3060
Width = 975
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "投坯日期"
Height = 315
Left = 1020
TabIndex = 24
Top = 2040
Width = 915
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "加工單編號"
Height = 255
Index = 4
Left = 1020
TabIndex = 23
Top = 240
Width = 1035
End
Begin VB.Label Label3
BackColor = &H00FFFFFF&
Caption = "布名"
Height = 255
Index = 1
Left = 1020
TabIndex = 22
Top = 1080
Width = 1035
End
Begin VB.Label Label11
BackColor = &H00FFFFFF&
Caption = "生產狀態"
Height = 255
Left = 1020
TabIndex = 21
Top = 660
Width = 1035
End
Begin VB.Image Image1
Height = 480
Left = 360
Picture = "frmProductionMan.frx":3AC2
Top = 480
Width = 480
End
Begin VB.Label Label12
BackColor = &H00FFFFFF&
Caption = "模糊查询项"
Height = 255
Left = 1920
TabIndex = 20
Top = 6780
Width = 915
End
Begin VB.Label Label15
BackColor = &H00C0FFC0&
Height = 195
Left = 1260
TabIndex = 19
Top = 6780
Width = 375
End
Begin VB.Label Label9
BackColor = &H00FFFFFF&
Caption = "加工廠簡稱"
Height = 315
Left = 1020
TabIndex = 18
Top = 1560
Width = 1035
End
Begin VB.Label Label8
BackColor = &H00FFFFFF&
Caption = "至"
Height = 255
Left = 5640
TabIndex = 17
Top = 2160
Width = 375
End
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHF1
Height = 8115
Left = 120
TabIndex = 2
Top = 240
Width = 14775
_ExtentX = 26061
_ExtentY = 14314
_Version = 393216
AllowUserResizing= 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
End
End
End
Attribute VB_Name = "frmProductionProgress"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim lngrow As Long
Private Sub ActiveBar21_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
Select Case Tool.Name
Case "cmdAdd":
frmProductionProgressInfo.newItem = True
frmProductionProgressInfo.Show vbModal
Case "cmdDel":
DelOperatorInf
Case "cmdCancel":
Unload Me
Case "cmdEdit":
EditOperatorInf
Case "cmdFind"
fraFind.Visible = True
Case "cmdRefurbish":
frmProductionProgress.FillMshf1 ("select * from tBusinessOrderSub a ,(select distinct orderno,delivery from tBusinessOrder) b where a.orderno=b.orderno order by a.orderno")
' Case "cmdPrint"
' Call PrintEmbryoContract
Case "cmdExport":
Dim strFile As String
frmMain.CDFile.ShowOpen
strFile = frmMain.CDFile.FileName
If strFile = "" Then Exit Sub
ExportExcel MSHF1, strFile
End Select
End Sub
Private Sub PrintEmbryoContract()
' If lngRow = 1 Then
' MsgBox "請選擇合約!", vbInformation + vbOKOnly, "提示"
' Exit Sub
' End If
' Dim rs As ADODB.Recordset
' Set rs = New ADODB.Recordset
' Dim strSql As String
' With rs
' .CursorLocation = adUseClient
' .CursorType = adOpenDynamic
' .LockType = adLockOptimistic
' Set .ActiveConnection = cn
' End With
' strSql = "select * from tProductionEmbryoContract as a,tBasicFabric as b "
' strSql = strSql & "where a.id=" & MSHF1.TextMatrix(lngRow, 24)
' strSql = strSql & "and a.FabricCode='" & MSHF1.TextMatrix(lngRow, 7) & "' and b.FabricCode='" & MSHF1.TextMatrix(lngRow, 7) & "'"
' rs.Open strSql
' With BillEmbryoContract
' .EmbryoContractNo.SetText (rs.Fields!EmbryoContractNo)
' .FoundDate.SetText (rs.Fields!FoundDate)
' .SuppliersName.SetText (rs.Fields!SuppliersName)
' .Linkman.SetText (rs.Fields!Linkman)
' .Operation.SetText (rs.Fields!Operation)
' .FabricName.SetText (rs.Fields!FabricName)
' .Composition.SetText (rs.Fields!Composition)
' .fWidth.SetText (MSHF1.TextMatrix(lngRow, 10))
' ' .fWidth.SetText (rs.Fields("tProductionEmbryoContract.width"))
' .FabricCode.SetText (rs.Fields!FabricCode)
' .Price.SetText (rs.Fields!Price)
' .Delivery.SetText (rs.Fields!Delivery)
' .Remark.SetText (rs.Fields!Remark)
' .Amount.SetText (rs.Fields!Amount)
' End With
' rs.Close
' Set rs = Nothing
' frmReportEmbryoContract.Show vbModal
End Sub
Private Function FormatQuery() As String
FormatQuery = "select * from tBusinessOrderSub a ,(select distinct orderno,delivery from tBusinessOrder) b where a.orderno=b.orderno"
If Trim$(txtOrderNo.Text) <> "" Then
FormatQuery = FormatQuery & " and a.OrderNo='" & txtOrderNo & "'"
End If
If Trim$(txtFabricNo) <> "" Then
FormatQuery = FormatQuery & " and FabricNo='" & txtFabricNo & "'"
End If
If Trim$(txtProductionState) <> "" Then
FormatQuery = FormatQuery & " and ProductionState='" & txtProductionState & "'"
End If
If Trim$(txtSeason) <> "" Then
FormatQuery = FormatQuery & " and Season='" & txtSeason & "'"
End If
If chkdelivery.Value = vbChecked Then
FormatQuery = FormatQuery & " and Delivery >= '" & FormatDateStr(Delivery.Value, "long") & "'"
FormatQuery = FormatQuery & " and Delivery <= '" & FormatDateStr(EndDelivery.Value, "long") & "'"
End If
If chkEmbryoDate.Value = vbChecked Then
FormatQuery = FormatQuery & " and EmbryoDate >= '" & FormatDateStr(EmbryoDate.Value, "long") & "'"
FormatQuery = FormatQuery & " and EmbryoDate <= '" & FormatDateStr(EndEmbryoDate.Value, "long") & "'"
End If
If chkItemDate1.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate1 >= '" & FormatDateStr(ItemDate1.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate1 <= '" & FormatDateStr(EndItemDate1.Value, "long") & "'"
End If
If chkItemDate2.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate2 >= '" & FormatDateStr(ItemDate2.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate2 <= '" & FormatDateStr(EndItemDate2.Value, "long") & "'"
End If
If chkItemDate3.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate3 >= '" & FormatDateStr(ItemDate3.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate3 <= '" & FormatDateStr(EndItemDate3.Value, "long") & "'"
End If
If chkItemDate4.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate4 >= '" & FormatDateStr(ItemDate4.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate4 <= '" & FormatDateStr(EndItemDate4.Value, "long") & "'"
End If
If chkItemDate5.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate5 >= '" & FormatDateStr(ItemDate5.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate5 <= '" & FormatDateStr(EndItemDate5.Value, "long") & "'"
End If
If chkItemDate6.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate6 >= '" & FormatDateStr(ItemDate6.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate6 <= '" & FormatDateStr(EndItemDate6.Value, "long") & "'"
End If
If chkItemDate7.Value = vbChecked Then
FormatQuery = FormatQuery & " and ItemDate7 >= '" & FormatDateStr(ItemDate7.Value, "long") & "'"
FormatQuery = FormatQuery & " and ItemDate7 <= '" & FormatDateStr(EndItemDate7.Value, "long") & "'"
End If
If Trim$(txtSuppliersName) <> "" Then
FormatQuery = FormatQuery & " and SuppliersName" & objDatabase.FormatLikeSQL(txtSuppliersName)
End If
If Trim$(txtFabricName) <> "" Then
FormatQuery = FormatQuery & " and FabricName" & objDatabase.FormatLikeSQL(txtFabricName)
End If
If Trim$(txtFactoryName) <> "" Then
FormatQuery = FormatQuery & " and FactoryName" & objDatabase.FormatLikeSQL(txtFactoryName)
End If
If Trim$(txtComposition) <> "" Then
FormatQuery = FormatQuery & " and Composition" & objDatabase.FormatLikeSQL(txtComposition)
End If
End Function
Private Sub cmdCancel_Click()
fraFind.Visible = False
End Sub
Private Sub CmdFind_Click()
FillMshf1 FormatQuery
fraFind.Visible = False
End Sub
Private Sub cmdFindAll_Click()
FillMshf1 ("select * from tBusinessOrderSub a,(select distinct Delivery,OrderNo from tBusinessOrder) c where a.orderno=c.orderno")
fraFind.Visible = False
End Sub
Private Sub CmdFabric_Click()
frmFabricSelect.Show vbModal
GetFabricInfo frmFabricSelect.FabricCode
End Sub
Private Sub GetFabricInfo(FabricNo As String)
Dim rs As ADODB.Recordset
' On Error GoTo errLabel
Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
Set .ActiveConnection = Cn
End With
rs.Open "select * from tBasicProduct where FabricCode=" & objDatabase.FormatSQL(FabricNo)
If Not rs.EOF Then
txtComposition = NullValue(rs.Fields!Composition)
txtFabricName = NullValue(rs.Fields!FabricName)
txtFabricNo = NullValue(rs.Fields!FabricCode)
End If
rs.Close
remClear:
Set rs = Nothing
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -