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

📄 frmrkxg.frm

📁 很好用的通用库存管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmRkXG 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "入库物资修改"
   ClientHeight    =   4950
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   3540
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4950
   ScaleWidth      =   3540
   Begin VB.TextBox Text2 
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1320
      TabIndex        =   1
      Top             =   2760
      Width           =   855
   End
   Begin VB.TextBox Text1 
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1320
      TabIndex        =   0
      Top             =   2280
      Width           =   1935
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保 存"
      Height          =   495
      Left            =   360
      TabIndex        =   5
      Top             =   4260
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   495
      Left            =   2040
      TabIndex        =   4
      Top             =   4260
      Width           =   1095
   End
   Begin VB.ComboBox Cmb3 
      Height          =   300
      Left            =   2280
      TabIndex        =   3
      Top             =   2760
      Width           =   1095
   End
   Begin VB.TextBox Text3 
      ForeColor       =   &H80000006&
      Height          =   735
      Left            =   1320
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   3240
      Width           =   2055
   End
   Begin VB.Label LabNums 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabNums"
      Height          =   180
      Left            =   1440
      TabIndex        =   19
      Top             =   1560
      Width           =   630
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "库存量"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   18
      Top             =   1560
      Width           =   615
   End
   Begin VB.Label LabDW 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabModel"
      Height          =   180
      Left            =   1440
      TabIndex        =   17
      Top             =   840
      Width           =   1680
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "单  位"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   16
      Top             =   840
      Width           =   615
   End
   Begin VB.Label LabName 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabName"
      Height          =   180
      Left            =   1440
      TabIndex        =   15
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "配件名称:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   14
      Top             =   120
      Width           =   735
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFC0C0&
      BorderWidth     =   3
      X1              =   120
      X2              =   3480
      Y1              =   1800
      Y2              =   1800
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "入库数量"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   360
      TabIndex        =   13
      Top             =   2280
      Width           =   720
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "单  价"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   12
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "规格型号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   360
      TabIndex        =   11
      Top             =   480
      Width           =   855
   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            =   960
      TabIndex        =   10
      Top             =   1920
      Width           =   1695
   End
   Begin VB.Label LabModel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabModel"
      Height          =   180
      Left            =   1440
      TabIndex        =   9
      Top             =   480
      Width           =   1680
   End
   Begin VB.Label LabDJ 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabDJ"
      Height          =   180
      Left            =   1440
      TabIndex        =   8
      Top             =   1200
      Width           =   1290
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "结款方式"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   360
      TabIndex        =   7
      Top             =   2760
      Width           =   720
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "备 注"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   480
      TabIndex        =   6
      Top             =   3480
      Width           =   450
   End
End
Attribute VB_Name = "FrmRkXG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Nums As Integer
Dim TotolNums As Integer

Private Sub Cmb3_Click()
Text2.Text = Cmb3.Text
End Sub

Private Sub Command1_Click()
If Val(Text1.Text) <= 0 Or Text1.Text = "" Then
 MsgBox "请输入入库数量!"
 Exit Sub
End If
If Text2.Text = "" Then
 MsgBox "请选择结款方式!"
 Exit Sub
End If


Dim a As Integer
 a = MsgBox("********你确定进行修改吗?**********" & vbCrLf _
        & "配件名称:" & LabName.Caption & vbCrLf _
        & "本次入库:" & Text1.Text & LabDW.Caption & "   单价:" & LabDJ.Caption & "元" & vbCrLf _
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
  
        sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & CStr(LabName.Caption) & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
     TotolNums = Rs.Fields("数量") + Val(Text1.Text) - Nums
         Rs!数量 = TotolNums
         Rs.Update
         Rs.Close
     
  
      sSql = "SELECT * FROM 入库物资 where ID =" & RemId
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
   Rs!数量 = Text1.Text
   Rs!金额 = Val(Text1.Text) * Val(LabDJ.Caption)
   Rs!结款方式 = Text2.Text
   If Text3.Text = "" Then Rs!备注 = "-" Else Rs!备注 = Text3.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()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
 Set Rs = New Recordset
Set_Init0
Set_Int
End Sub
Private Sub Set_Int()
 'On Error GoTo DataErr
    sSql = "SELECT * FROM 入库物资 where ID =" & RemId
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText

 LabName.Caption = Rs.Fields("配件名称")
 LabModel.Caption = Rs.Fields("规格型号")
 LabDW.Caption = Rs.Fields("单位")
 LabDJ.Caption = Rs.Fields("单价")
 Nums = Rs.Fields("数量")
 Text1.Text = Rs.Fields("数量")
 Text2.Text = Rs.Fields("结款方式")
 
 If Rs.Fields("备注") = "-" Then Text3.Text = "" Else Text3.Text = Rs.Fields("备注")

Rs.Close

     sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & LabName.Caption & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
     LabNums.Caption = Rs!数量
     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

⌨️ 快捷键说明

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