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

📄 frmgoodmngmt.frm

📁 This a complete inventory management system that performs the functions of Purchases, Sales and paym
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Left            =   4440
            TabIndex        =   15
            Top             =   420
            Width           =   345
         End
      End
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   120
      Top             =   840
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   22
      ImageHeight     =   22
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   5
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmGoodmngmt.frx":001C
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmGoodmngmt.frx":0365
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmGoodmngmt.frx":082A
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmGoodmngmt.frx":0D1C
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmGoodmngmt.frx":1179
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.Toolbar Tlb_Kit 
      Align           =   1  'Align Top
      Height          =   630
      Left            =   0
      TabIndex        =   9
      Top             =   0
      Width           =   10815
      _ExtentX        =   19076
      _ExtentY        =   1111
      ButtonWidth     =   1058
      ButtonHeight    =   1111
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   10
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "&New"
            Key             =   "New"
            Object.ToolTipText     =   "New"
            ImageIndex      =   1
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "&Save"
            Key             =   "Save"
            Object.ToolTipText     =   "Save"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "&Edit"
            Key             =   "Edit"
            Object.ToolTipText     =   "Edit"
            ImageIndex      =   3
         EndProperty
         BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "Delete"
            Key             =   "tbrDelete"
            ImageIndex      =   4
         EndProperty
         BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "&Close"
            Key             =   "tbrClose"
            Object.ToolTipText     =   "Exit"
            ImageIndex      =   5
         EndProperty
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmGoodmngmt"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDispParty_Click()
    popVendor.Show vbModal
    gId = popVendor.txtBranchId
    txtPartyId = Trim(gId)
    txtParty = VNID2VNName(Trim(gId))
    'MsgBox gId
    Unload popBranch
End Sub

Private Sub cmdDispProd_Click()
    popBook.Show vbModal
    gId = popBook.txtBookID
    txtprodId = Trim(gId)
    txtPname = PID2PName(Trim(gId))
    Unload popBook
End Sub


Private Sub dtIn_Date_Change()
   GetAvlbQty
End Sub

Private Sub dtIn_Date_Click()
    GetAvlbQty
End Sub

Private Sub Form_Load()
    dtIn_Date.Value = Now
End Sub

Private Sub Tlb_Kit_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
    Case 1
        Call fn_new
    Case 3
        Call fn_Save
    Case 5
        Call fn_Edit
    Case 7
        fn_Delete
    Case 9
        Call fn_Exit
End Select
End Sub

Private Function fn_Exit()
Unload Me
End Function

Private Function fn_new()
Unload Me
Load Me
End Function
Private Function fn_Save()
Dim msql As String
If txtprodId = "" Then
    MsgBox "Please Specify Product Name", vbInformation
    txtPname.SetFocus
ElseIf txtPname = "" Then
    MsgBox "Please Specify Product Name", vbInformation
    txtPname.SetFocus
ElseIf txtPartyId = "" Then
    MsgBox "Please Specify Party Name", vbInformation
    txtParty.SetFocus
ElseIf txtParty = "" Then
    MsgBox "Please Specify Party Name", vbInformation
    txtParty.SetFocus
ElseIf txtBillNo = "" Then
    MsgBox "Please Specify Bill No.", vbInformation
    txtBillNo.SetFocus
ElseIf txtSize = "" Then
    MsgBox "Please Specify Size.", vbInformation
    txtSize.SetFocus
Else
    msql = "insert into stock(product_id,size_set,product_name,party_id,party_name,bill_no,in_date,avlb_qty,qty_in,qty_out,rest_qty) values('" & txtprodId & "','" & Trim(txtSize) & "','" & txtPname & "','" & txtPartyId & "','" & txtParty & "','" & txtBillNo & "','" & dtIn_Date.Value & "'," & txtavlbQty & "," & txtQtyIn & "," & txtQtyOut & "," & txtRestQty & ")"
    CNimanager.Execute (msql)
    MsgBox "Stock entered successfully....", vbInformation
    fn_new
End If
End Function

Private Sub txtPname_Change()
    GetAvlbQty
End Sub

Private Sub txtQtyIn_Validate(Cancel As Boolean)
    If txtQtyIn = "" Then
        txtQtyIn = 0
    End If
    If Not IsNumeric(txtQtyIn) Then
        MsgBox "Enter valid quantity...", vbInformation
        Cancel = True
    End If
    GetRestQty
End Sub

Private Sub txtQtyOut_Validate(Cancel As Boolean)
    If txtQtyOut = "" Then
        txtQtyOut = 0
    End If
    
    If Not IsNumeric(txtQtyOut) Then
        MsgBox "Enter valid quantity...", vbInformation
        Cancel = True
    End If
    
    GetRestQty
End Sub

Private Function GetRestQty()
    txtRestQty = CDbl(txtavlbQty) + CDbl(txtQtyIn)
End Function

Private Function GetAvlbQty()
Dim msql As String
Dim rsCheckStock As New ADODB.Recordset

msql = "Select sum(qty_in)-sum(qty_out) as avlbQty from stock where product_id='" & txtprodId & "' and in_date<=#" & dtIn_Date & "# and size_set='" & Trim(txtSize) & "'"
rsCheckStock.Open msql, CNimanager
If Not rsCheckStock.EOF Then
   If IsNull(rsCheckStock("avlbQty")) Then
        txtavlbQty = 0
    Else
        txtavlbQty = rsCheckStock("avlbQty")
    End If
Else
    txtavlbQty = 0
End If
lblUnit1.Caption = PID2Unit(txtprodId)
lblUnit2.Caption = PID2Unit(txtprodId)
lblUnit3.Caption = PID2Unit(txtprodId)
rsCheckStock.Close
Set rsCheckStock = Nothing
GetRestQty
End Function

Private Sub fn_Edit()
    popStock.Show vbModal
    txtSno = popStock.txtBookID
    Unload popStock
End Sub

Private Sub fn_Delete()
Dim msql As String
Dim ans
msql = "Delete from stock where sno=" & txtSno
ans = MsgBox("Are you Sure...", vbYesNoCancel)

If ans = vbYes Then
    CNimanager.Execute (msql)
    MsgBox "Record Deleted Successfully..", vbInformation
    Unload Me
    Load Me
End If
End Sub

Private Sub txtSize_LostFocus()
    GetAvlbQty
End Sub

⌨️ 快捷键说明

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