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

📄 frmrk.frm

📁 很好用的通用库存管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmRK 
   BorderStyle     =   0  'None
   Caption         =   "名称"
   ClientHeight    =   5220
   ClientLeft      =   2790
   ClientTop       =   3150
   ClientWidth     =   3765
   ControlBox      =   0   'False
   FillColor       =   &H00404040&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   348
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   251
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox Text2 
      ForeColor       =   &H80000006&
      Height          =   735
      Left            =   1440
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   3
      Top             =   3840
      Width           =   1815
   End
   Begin VB.ComboBox Cmb3 
      Height          =   300
      Left            =   1440
      TabIndex        =   2
      Top             =   3360
      Width           =   1815
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   495
      Left            =   2040
      TabIndex        =   18
      Top             =   4680
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "办理入库"
      Height          =   495
      Left            =   360
      TabIndex        =   17
      Top             =   4680
      Width           =   1095
   End
   Begin VB.ComboBox Cmb2 
      Height          =   300
      Left            =   1320
      TabIndex        =   12
      Top             =   1140
      Width           =   2295
   End
   Begin VB.ComboBox Cmb1 
      Height          =   300
      Left            =   1320
      TabIndex        =   11
      Top             =   660
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1440
      TabIndex        =   0
      Top             =   2992
      Width           =   1815
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "备 注"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   600
      TabIndex        =   20
      Top             =   4080
      Width           =   450
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "结款方式"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   480
      TabIndex        =   19
      Top             =   3480
      Width           =   720
   End
   Begin VB.Label LabDJ 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Height          =   180
      Left            =   1320
      TabIndex        =   16
      Top             =   2040
      Width           =   330
   End
   Begin VB.Label LabDW 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Height          =   180
      Left            =   3240
      TabIndex        =   15
      Top             =   2040
      Width           =   90
   End
   Begin VB.Label LabModel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Height          =   180
      Left            =   1320
      TabIndex        =   14
      Top             =   1770
      Width           =   90
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "入库物资详细资料"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00008000&
      Height          =   255
      Left            =   840
      TabIndex        =   13
      Top             =   2520
      Width           =   1695
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "规格型号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   10
      Top             =   1740
      Width           =   855
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "单  价"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   9
      Top             =   2040
      Width           =   615
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "入库数量"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   480
      TabIndex        =   8
      Top             =   3000
      Width           =   720
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFC0C0&
      BorderWidth     =   3
      X1              =   0
      X2              =   248
      Y1              =   160
      Y2              =   160
   End
   Begin VB.Label LabNum 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      ForeColor       =   &H000000FF&
      Height          =   180
      Left            =   2880
      TabIndex        =   7
      Top             =   2040
      Width           =   105
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "目前库存量"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   1740
      TabIndex        =   6
      Top             =   2040
      Width           =   900
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "配件名称:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   5
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "配件类型:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   4
      Top             =   720
      Width           =   735
   End
   Begin VB.Image imgTitleHelp 
      Height          =   195
      Left            =   9960
      Picture         =   "frmRK.frx":0000
      Top             =   120
      Width           =   195
   End
   Begin VB.Image imgTitleMinimize 
      Height          =   195
      Left            =   9960
      Picture         =   "frmRK.frx":024A
      Top             =   840
      Width           =   195
   End
   Begin VB.Image imgTitleClose 
      Height          =   195
      Left            =   9960
      Picture         =   "frmRK.frx":0494
      Top             =   480
      Width           =   195
   End
   Begin VB.Label lblTitle 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "入库"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   240
      Left            =   9480
      TabIndex        =   1
      Top             =   1200
      Width           =   420
   End
   Begin VB.Image imgTitleMain 
      Height          =   450
      Left            =   8520
      Picture         =   "frmRK.frx":06DE
      Stretch         =   -1  'True
      Top             =   600
      Width           =   285
   End
   Begin VB.Image imgWindowBottomRight 
      Height          =   450
      Left            =   9600
      Picture         =   "frmRK.frx":0E28
      Top             =   120
      Width           =   285
   End
   Begin VB.Image imgWindowRight 
      Height          =   450
      Left            =   9600
      Picture         =   "frmRK.frx":1572
      Stretch         =   -1  'True
      Top             =   600
      Width           =   285
   End
   Begin VB.Image imgWindowLeft 
      Height          =   450
      Left            =   9240
      Picture         =   "frmRK.frx":1CBC
      Stretch         =   -1  'True
      Top             =   600
      Width           =   285
   End
   Begin VB.Image imgWindowBottom 
      Height          =   450
      Left            =   8880
      Picture         =   "frmRK.frx":2406
      Stretch         =   -1  'True
      Top             =   600
      Width           =   285
   End
   Begin VB.Image imgWindowBottomLeft 
      Height          =   450
      Left            =   9240
      Picture         =   "frmRK.frx":2B50
      Top             =   120
      Width           =   285
   End
   Begin VB.Image imgTitleRight 
      Height          =   450
      Left            =   8880
      Picture         =   "frmRK.frx":329A
      Top             =   120
      Width           =   285
   End
   Begin VB.Image imgTitleLeft 
      Height          =   450
      Left            =   8520
      Picture         =   "frmRK.frx":39E4
      Top             =   120
      Width           =   285
   End
End
Attribute VB_Name = "frmRK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim TotolNums As Integer
Private Sub Cmb1_Click()
Set_Init1
End Sub
Private Sub Cmb2_Click()
If Cmb1.Text = "" Then
 MsgBox "请先选择类别!"
 Exit Sub
End If
Set_Init2
End Sub
Private Sub Command1_Click()
If Val(Text1.Text) <= 0 Or Text1.Text = "" Then
 MsgBox "请输入入库数量!"
 Exit Sub
End If
If Cmb2.Text = "" Then
 MsgBox "请选择入库配件名称!"
 Exit Sub
End If
If Cmb3.Text = "" Then
 MsgBox "请选择结款方式!"
 Exit Sub
End If

Dim a As Integer
 a = MsgBox("********你确定此操作吗?**********" & vbCrLf _
        & "材料名称:" & Cmb2.Text & vbCrLf _
        & "原库存量:" & LabNum.Caption & LabDW.Caption & vbCrLf _
        & "本次入库:" & Text1.Text & LabDW.Caption & "   单价:" & LabDJ.Caption & "元" & vbCrLf _
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
  
        sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & CStr(Cmb2.Text) & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
     TotolNums = Rs.Fields("数量") + Val(Text1.Text)
         Rs!数量 = TotolNums
         Rs.Update
         Rs.Close
     
  
      sSql = "SELECT * FROM 入库物资"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
   Rs.AddNew
   Rs!入库单号 = Bill
   Rs!配件名称 = Cmb2.Text
   Rs!规格型号 = LabModel.Caption
   Rs!单位 = LabDW.Caption
   Rs!数量 = Text1.Text
   Rs!单价 = LabDJ.Caption
   Rs!金额 = Val(Text1.Text) * Val(LabDJ.Caption)
   Rs!结款方式 = Cmb3.Text
   If Text2.Text = "" Then Rs!备注 = "-" Else Rs!备注 = Text2.Text
   Rs.Update
   Rs.Close
  MsgBox "入库成功!"
FrmRKList.Show
Unload Me
End If
If a = 2 Then Exit Sub
End Sub

Private Sub Command2_Click()
FrmRKList.Show
Unload Me
End Sub
Private Sub Form_Load()
  MakeWindow Me
   ' AlwaysOnTop Me, True
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
 Set Rs = New Recordset
 Set_Init
 Set_Init0
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim MyStr As String
MyStr = "临沂长安物贸库存管理由天海星天海工作室开发"
MDIFrmMain.MovingText1.MsgChar = MyStr
End Sub

Private Sub imgTitleClose_Click()
Unload Me
End Sub

Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    DoDrag Me
End Sub

Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    DoDrag Me
End Sub
Private Sub imgTitleMinimize_Click()
    Me.WindowState = 1
End Sub
Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    DoDrag Me
End Sub

Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    DoDrag Me
End Sub
Private Sub Set_Init()
Dim i As Integer
 On Error GoTo DataErr
  
  sSql = "SELECT 分类 FROM 配件分类表"
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
 Cmb1.Clear
Do While Not Rs.EOF
 Cmb1.AddItem Rs.Fields(0)
 Rs.MoveNext
 Loop
Rs.Close

  Exit Sub
DataErr:
     MsgBox Err.Description
End Sub
Private Sub Set_Init0()
Dim i As Integer
 On Error GoTo DataErr
sSql = "SELECT ID, 结款方式 FROM 结款方式"
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
 Cmb3.Clear
Do While Not Rs.EOF
 Cmb3.AddItem Rs.Fields("结款方式")
 Rs.MoveNext
 Loop
Rs.Close

  Exit Sub
DataErr:
     MsgBox Err.Description
End Sub
Private Sub Set_Init1()
Dim i As Integer
 On Error GoTo DataErr
sSql = "SELECT ID, 配件名称,规格型号,分类,单位,单价,数量 FROM 配件库存表 WHERE 分类 = '" & CStr(Cmb1.Text) & "'"
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
 Cmb2.Clear
Do While Not Rs.EOF
 Cmb2.AddItem Rs.Fields("配件名称")
 Rs.MoveNext
 Loop
Rs.Close

  Exit Sub
DataErr:
     MsgBox Err.Description
End Sub
Private Sub Set_Init2()
Dim i As Integer
 On Error GoTo DataErr
sSql = "SELECT  ID,配件名称,规格型号,分类,单位,单价,数量 FROM 配件库存表 WHERE 配件名称 = '" & CStr(Cmb2.Text) & "'"
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
 If Not Rs.EOF Then
 LabModel = Rs.Fields("规格型号")
 LabDW = Rs.Fields("单位")
 LabDJ = Rs.Fields("单价")
 LabNum.Caption = Rs.Fields("数量")
End If
Rs.Close

  Exit Sub
DataErr:
     MsgBox Err.Description
End Sub

⌨️ 快捷键说明

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