⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmproductionsummarytest.frm

📁 企业ERP系统 采用VB+SQL2000实现。 有客户合约
💻 FRM
字号:
VERSION 5.00
Object = "{4932CEF1-2CAA-11D2-A165-0060081C43D9}#2.0#0"; "Actbar2.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmProductionSummaryTest 
   Caption         =   "測試"
   ClientHeight    =   2985
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6750
   LinkTopic       =   "Form1"
   ScaleHeight     =   2985
   ScaleWidth      =   6750
   StartUpPosition =   3  'Windows Default
   Begin ActiveBar2LibraryCtl.ActiveBar2 ActiveBar21 
      Height          =   2985
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6750
      _LayoutVersion  =   1
      _ExtentX        =   11906
      _ExtentY        =   5265
      _DataPath       =   ""
      Bands           =   "frmProductionSummaryTest.frx":0000
      Begin VB.Frame Frame1 
         Height          =   2355
         Left            =   60
         TabIndex        =   1
         Top             =   540
         Width           =   6555
         Begin VB.TextBox txtReport 
            Height          =   1035
            Left            =   1320
            MultiLine       =   -1  'True
            ScrollBars      =   3  'Both
            TabIndex        =   9
            Top             =   1140
            Width           =   5055
         End
         Begin VB.CheckBox ChkTest 
            Caption         =   "Check1"
            Height          =   255
            Left            =   1320
            TabIndex        =   7
            Top             =   720
            Width           =   255
         End
         Begin MSComCtl2.DTPicker DTPTestDate 
            Height          =   315
            Left            =   4380
            TabIndex        =   6
            Top             =   720
            Width           =   1995
            _ExtentX        =   3519
            _ExtentY        =   556
            _Version        =   393216
            Format          =   87687169
            CurrentDate     =   39664
         End
         Begin VB.TextBox txtOrderNo 
            BackColor       =   &H8000000F&
            Enabled         =   0   'False
            Height          =   315
            Left            =   1320
            MaxLength       =   20
            TabIndex        =   2
            Top             =   240
            Width           =   1995
         End
         Begin VB.Label Label2 
            Caption         =   "查货报告"
            Height          =   255
            Left            =   180
            TabIndex        =   8
            Top             =   1140
            Width           =   735
         End
         Begin VB.Label Label1 
            Caption         =   "測試日期"
            Height          =   255
            Left            =   3240
            TabIndex        =   5
            Top             =   720
            Width           =   855
         End
         Begin VB.Label Label50 
            Caption         =   "加工單編號"
            Height          =   315
            Left            =   180
            TabIndex        =   4
            Top             =   300
            Width           =   975
         End
         Begin VB.Label Label22 
            Caption         =   "測試結果"
            Height          =   255
            Left            =   180
            TabIndex        =   3
            Top             =   720
            Width           =   1035
         End
      End
   End
End
Attribute VB_Name = "frmProductionSummaryTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub ActiveBar21_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
    Select Case Tool.Name
            Case "cmdSave":
                Call Save
           Case "cmdCancel":
                Unload Me
    End Select
End Sub
Private Sub Form_Load()
    Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
    InitTitle
End Sub
Private Sub InitTitle()
    Label1.Caption = "測試日期"
    Label50.Caption = "加工單編號"
    Label22.Caption = "測試結果"
    Label2.Caption = "查货报告"
    Me.Caption = "測試結果"
End Sub
Public Sub InitInfo(strId As String)
    Dim rs As ADODB.Recordset
      SystemExecuteStart Me
     ' On Error GoTo errLabel
      Set rs = New ADODB.Recordset
      With rs
        .CursorLocation = adUseClient
        .CursorType = adOpenDynamic
        .LockType = adLockBatchOptimistic
        Set .ActiveConnection = Cn
      End With
      Dim strSql As String
        strSql = "select * from tBusinessOrderSub where OrderNo='" & strId & "'"
        rs.Open strSql
        If Not rs.EOF Then
            DTPTestDate.Value = NullValue(rs.Fields!MtlDate)
            txtOrderNo = NullValue(rs.Fields!OrderNo)
            ChkTest.Value = IIf(rs.Fields!MtlResult, "1", "0")
            txtReport = Trim$(NullValue(rs.Fields!Report))
        End If
      rs.Close
      Set rs = Nothing
      SystemExecuteEnd Me
    Exit Sub
errLabel:
        SystemExecuteEnd Me
        objDatabase.DatabaseError
End Sub
Private Sub Save()
    Dim strSql As String
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    With rs
      .CursorLocation = adUseClient
      .CursorType = adOpenDynamic
      .LockType = adLockOptimistic
      Set .ActiveConnection = Cn
    End With
    If txtOrderNo = "" Then
       MsgBox "請將加工單編號填寫完整 ", vbInformation + vbOKOnly, " 提示"
       Exit Sub
    End If
        On Error GoTo errHandle
            strSql = "select * from tBusinessOrderSub where OrderNo='" & txtOrderNo & "'"
            rs.Open strSql
            If rs.EOF Then '修改
                MsgBox "没有可修改的信息!", vbExclamation, "修改"
                rs.Close
                Set rs = Nothing
                txtOrderNo.SetFocus
                Exit Sub
            End If
            If MsgBox("是否修改记录?", vbYesNo + vbQuestion, "修改") = vbNo Then
                rs.Close
                Set rs = Nothing
                Exit Sub
            End If
        rs.Fields!MtlResult = ChkTest.Value
        rs.Fields!MtlDate = DTPTestDate.Value
        rs.Fields!Report = txtReport
        rs.Update
        MsgBox "操作成功!", vbInformation, "恭喜"
        rs.Close
        Set rs = Nothing
        frmProductionSummary.FillMshf1 ("select * from tBusinessOrder a ,(select orderno,Labdip,LateDate,Composition,LayoutColor,ReportDate,SuppliersName,EmbryoAmount,ProductionState,ProductionQuantity,season,UlkColor,UlkQuality,UlkLayout,Report,MtlResult,Price,ShipmentsAmount from tBusinessOrderSub) b where a.orderno=b.orderno")
        Unload Me
        Exit Sub
errHandle:
    Set rs = Nothing
    objDatabase.DatabaseError
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -