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

📄 frmassortedproductae.frm

📁 Inventory control system
💻 FRM
📖 第 1 页 / 共 3 页
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{FF49E21B-EA30-11D9-85DF-812F544F012A}#69.0#0"; "ctrlNSDataCombo.ocx"
Begin VB.Form frmAssortedProductAE 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Assorted Product"
   ClientHeight    =   7245
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9420
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7245
   ScaleWidth      =   9420
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CmdTasks 
      Caption         =   "Assorted Product Tasks"
      Height          =   315
      Left            =   5550
      TabIndex        =   11
      Top             =   5520
      Width           =   1995
   End
   Begin VB.CommandButton btnRemove 
      Height          =   275
      Left            =   270
      Picture         =   "frmAssortedProductAE.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   22
      ToolTipText     =   "Remove"
      Top             =   2970
      Visible         =   0   'False
      Width           =   275
   End
   Begin VB.TextBox txtNotes 
      Height          =   1335
      Left            =   180
      MaxLength       =   255
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   12
      Tag             =   "Remarks"
      Top             =   5790
      Width           =   4980
   End
   Begin VB.ComboBox cboStatus 
      Height          =   315
      ItemData        =   "frmAssortedProductAE.frx":01B2
      Left            =   1290
      List            =   "frmAssortedProductAE.frx":01BC
      TabIndex        =   4
      Text            =   "On Hold"
      Top             =   1380
      Width           =   2325
   End
   Begin VB.CommandButton cmdSave 
      Caption         =   "&Save"
      Height          =   315
      Left            =   7620
      TabIndex        =   9
      Top             =   5520
      Width           =   855
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "Cancel"
      Height          =   315
      Left            =   8535
      TabIndex        =   10
      Top             =   5520
      Width           =   795
   End
   Begin VB.PictureBox picPurchase 
      BorderStyle     =   0  'None
      Height          =   630
      Left            =   240
      ScaleHeight     =   630
      ScaleWidth      =   9105
      TabIndex        =   13
      Top             =   1860
      Width           =   9105
      Begin VB.TextBox txtQty 
         Alignment       =   1  'Right Justify
         Height          =   285
         Left            =   4125
         TabIndex        =   6
         Text            =   "0"
         Top             =   240
         Width           =   660
      End
      Begin VB.CommandButton btnAdd 
         Caption         =   "Add"
         Enabled         =   0   'False
         Height          =   315
         Left            =   6030
         TabIndex        =   8
         Top             =   270
         Width           =   840
      End
      Begin ctrlNSDataCombo.NSDataCombo nsdStock 
         Height          =   315
         Left            =   0
         TabIndex        =   5
         Top             =   225
         Width           =   4050
         _ExtentX        =   7144
         _ExtentY        =   556
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MSDataListLib.DataCombo dcUnit 
         Height          =   315
         Left            =   4830
         TabIndex        =   7
         Top             =   240
         Width           =   945
         _ExtentX        =   1667
         _ExtentY        =   556
         _Version        =   393216
         Style           =   2
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Text            =   ""
      End
      Begin VB.Label Labels 
         BackStyle       =   0  'Transparent
         Caption         =   "Qty"
         Height          =   240
         Index           =   10
         Left            =   4125
         TabIndex        =   16
         Top             =   0
         Width           =   660
      End
      Begin VB.Label Labels 
         BackStyle       =   0  'Transparent
         Caption         =   "Items/Stocks"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000011D&
         Height          =   240
         Index           =   8
         Left            =   0
         TabIndex        =   15
         Top             =   0
         Width           =   1515
      End
      Begin VB.Label Labels 
         BackStyle       =   0  'Transparent
         Caption         =   "Unit"
         Height          =   240
         Index           =   2
         Left            =   4830
         TabIndex        =   14
         Top             =   0
         Width           =   900
      End
   End
   Begin VB.TextBox txtQtyParent 
      Height          =   315
      Left            =   1290
      TabIndex        =   1
      Top             =   600
      Width           =   2115
   End
   Begin ctrlNSDataCombo.NSDataCombo nsdProduct 
      Height          =   315
      Left            =   1290
      TabIndex        =   0
      Top             =   210
      Width           =   5100
      _ExtentX        =   8996
      _ExtentY        =   556
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid 
      Height          =   2610
      Left            =   210
      TabIndex        =   17
      TabStop         =   0   'False
      Top             =   2820
      Width           =   9105
      _ExtentX        =   16060
      _ExtentY        =   4604
      _Version        =   393216
      Rows            =   0
      FixedRows       =   0
      FixedCols       =   0
      RowHeightMin    =   275
      ForeColorFixed  =   -2147483640
      BackColorSel    =   1091552
      ForeColorSel    =   16777215
      BackColorBkg    =   -2147483643
      GridColor       =   -2147483633
      GridColorFixed  =   -2147483633
      GridColorUnpopulated=   -2147483633
      AllowBigSelection=   0   'False
      FocusRect       =   0
      SelectionMode   =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _NumberOfBands  =   1
      _Band(0).Cols   =   2
      _Band(0).GridLinesBand=   1
      _Band(0).TextStyleBand=   0
      _Band(0).TextStyleHeader=   0
   End
   Begin VB.TextBox txtDate 
      Height          =   315
      Left            =   1290
      TabIndex        =   3
      Top             =   990
      Width           =   2505
   End
   Begin MSComCtl2.DTPicker dtpDate 
      Height          =   315
      Left            =   1290
      TabIndex        =   2
      Top             =   990
      Width           =   2505
      _ExtentX        =   4419
      _ExtentY        =   556
      _Version        =   393216
      CustomFormat    =   "MMM-dd-yyyy"
      Format          =   44695555
      CurrentDate     =   38207
   End
   Begin VB.Label Labels 
      Alignment       =   1  'Right Justify
      Caption         =   "Date"
      Height          =   255
      Index           =   1
      Left            =   210
      TabIndex        =   24
      Top             =   1020
      Width           =   1035
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "Details"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000014&
      Height          =   210
      Left            =   270
      TabIndex        =   23
      Top             =   2520
      Width           =   4365
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000014&
      Index           =   1
      X1              =   180
      X2              =   9300
      Y1              =   1740
      Y2              =   1740
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      Index           =   1
      X1              =   180
      X2              =   9300
      Y1              =   1770
      Y2              =   1770
   End
   Begin VB.Label Labels 
      Caption         =   "Notes"
      Height          =   240
      Index           =   4
      Left            =   180
      TabIndex        =   21
      Top             =   5520
      Width           =   990
   End
   Begin VB.Label Label12 
      Alignment       =   1  'Right Justify
      Caption         =   "Status"
      Height          =   255
      Left            =   210
      TabIndex        =   20
      Top             =   1410
      Width           =   1035
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      Caption         =   "Qty"
      Height          =   255
      Left            =   210
      TabIndex        =   19
      Top             =   630
      Width           =   1035
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "Product"
      Height          =   255
      Left            =   210
      TabIndex        =   18
      Top             =   210
      Width           =   1035
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H80000010&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H80000010&
      Height          =   240
      Left            =   210
      Top             =   2520
      Width           =   9105
   End
   Begin VB.Menu mnu_Tasks 
      Caption         =   "Tasks"
      Visible         =   0   'False
      Begin VB.Menu mnu_History 
         Caption         =   "History"
      End
   End
End
Attribute VB_Name = "frmAssortedProductAE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public State                As FormState 'Variable used to determine on how the form used
Public PK                   As Long 'Variable used to get what record is going to edit
Public CloseMe              As Boolean
Public ForCusAcc            As Boolean

Dim cIRowCount              As Integer

Dim HaveAction              As Boolean 'Variable used to detect if the user perform some action
Dim rs                      As New Recordset 'Main recordset for Invoice
Dim blnSave                 As Boolean
Dim intQtyOld               As Integer 'Old txtQty Value. Hold when editing qty

Private Sub btnAdd_Click()
On Error GoTo erR
    
    Dim RSStockUnit As New Recordset
    
    Dim intTotalOnhand          As Integer
    Dim intTotalIncoming        As Integer
    Dim intTotalOnhInc          As Integer 'Total of Onhand + Incoming
    Dim intExcessQty            As Integer
    
    Dim intSuggestedQty         As Integer
    Dim blnAddIncoming          As Boolean
    Dim intQtyOrdered           As Integer 'hold the value of txtQty
    Dim intCount                As Integer
    
    If nsdStock.Text = "" Then nsdStock.SetFocus: Exit Sub
    
    If dcUnit.Text = "" Then
        MsgBox "Please select unit", vbInformation
        dcUnit.SetFocus
        Exit Sub
    End If
    
    Dim CurrRow As Integer

    Dim intStockID As Integer
    
    CurrRow = getFlexPos(Grid, 4, nsdStock.Tag)
    intStockID = nsdStock.Tag
    
    RSStockUnit.CursorLocation = adUseClient
    RSStockUnit.Open "SELECT * FROM qry_Stock_Unit WHERE StockID =" & intStockID & " ORDER BY Stock_Unit.Order ASC", CN, adOpenStatic, adLockOptimistic
    
    intQtyOrdered = txtQty.Text
              
    RSStockUnit.Find "UnitID = " & dcUnit.BoundText
          
    If RSStockUnit!Onhand < intQtyOrdered Then GoSub GetOnhand

Continue:
    'Save to stock card
'    Dim RSStockCard As New Recordset
'
'    RSStockCard.CursorLocation = adUseClient
'    RSStockCard.Open "SELECT * FROM Stock_Card", CN, adOpenStatic, adLockOptimistic

    'Add to grid
    With Grid
        If CurrRow < 0 Then
            'Perform if the record is not exist
            If .Rows = 2 And .TextMatrix(1, 4) = "" Then
                .TextMatrix(1, 1) = nsdStock.Text
                .TextMatrix(1, 2) = intQtyOrdered 'txtQty.Text
                .TextMatrix(1, 3) = dcUnit.Text
                .TextMatrix(1, 4) = intStockID
            Else
AddIncoming:
                .Rows = .Rows + 1
                .TextMatrix(.Rows - 1, 1) = nsdStock.Text
                .TextMatrix(.Rows - 1, 2) = intQtyOrdered 'txtQty.Text
                .TextMatrix(.Rows - 1, 3) = dcUnit.Text
                .TextMatrix(.Rows - 1, 4) = intStockID
                
                .FillStyle = 1

                .Row = .Rows - 1
                .ColSel = 3
                If blnAddIncoming = True And intCount = 2 Then
                    .CellForeColor = vbBlue
                    
                    blnAddIncoming = False
                End If
            End If

⌨️ 快捷键说明

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