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

📄 frmpjxg.frm

📁 很好用的通用库存管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmPJXG 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "配件修改"
   ClientHeight    =   4920
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4035
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4920
   ScaleWidth      =   4035
   Begin VB.TextBox TxtNums 
      Appearance      =   0  'Flat
      Enabled         =   0   'False
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   5
      Top             =   2880
      Width           =   2535
   End
   Begin VB.TextBox TxtPJLX 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   0
      Top             =   480
      Width           =   1335
   End
   Begin VB.TextBox TxtName 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   1
      Top             =   960
      Width           =   2535
   End
   Begin VB.ComboBox Cmb1 
      Height          =   300
      Left            =   2640
      TabIndex        =   9
      Top             =   480
      Width           =   1095
   End
   Begin VB.CommandButton CmdSave 
      Caption         =   "保  存"
      Height          =   495
      Left            =   360
      TabIndex        =   7
      Top             =   4200
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   495
      Left            =   2280
      TabIndex        =   8
      Top             =   4200
      Width           =   1095
   End
   Begin VB.TextBox TxtBZ 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   735
      Left            =   1200
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   6
      Top             =   3360
      Width           =   2535
   End
   Begin VB.TextBox TxtModel 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   2
      Top             =   1425
      Width           =   2535
   End
   Begin VB.TextBox TxtDW 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   3
      Top             =   1905
      Width           =   2535
   End
   Begin VB.TextBox TxtDJ 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   4
      Top             =   2400
      Width           =   2535
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "库存量"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   17
      Top             =   2880
      Width           =   615
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "配件类型:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   16
      Top             =   540
      Width           =   735
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "配件名称:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   15
      Top             =   1020
      Width           =   735
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "规格型号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   14
      Top             =   1440
      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            =   1440
      TabIndex        =   13
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "备 注"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   12
      Top             =   3600
      Width           =   450
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "单  位"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   1920
      Width           =   615
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "单  价"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   10
      Top             =   2400
      Width           =   615
   End
End
Attribute VB_Name = "FrmPJXG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim PJName As String
Private Sub Make_Save()
   sSql = "SELECT * FROM 配件库存表 where ID =" & RemId
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
  Rs!配件名称 = TxtName.Text
   Rs!规格型号 = TxtModel.Text
   Rs!分类 = TxtPJLX.Text
   Rs!单位 = TxtDW.Text
   Rs!单价 = TxtDJ.Text
   If TxtBZ.Text = "" Then Rs!备注 = "-" Else Rs!备注 = TxtBZ.Text
   Rs.Update
   Rs.Close
End Sub
Private Sub Cmb1_Click()
TxtPJLX.Text = Cmb1.Text
End Sub

Private Sub CmdSave_Click()
If TxtPJLX.Text = "" Then
 MsgBox "请选择配件类型!"
 Exit Sub
End If
If TxtName.Text = "" Then
 MsgBox "请输入配件名称!"
 Exit Sub
End If
If TxtModel.Text = "" Then
 MsgBox "请输入规格型号!"
 Exit Sub
End If
If TxtDW.Text = "" Then
 MsgBox "请输入单位!"
 Exit Sub
End If
If TxtDJ.Text = "" Then
 MsgBox "请输入单价!"
 Exit Sub
End If

  If TxtName.Text <> PJName Then
     sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & CStr(TxtName.Text) & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
    If Not Rs.EOF Then
      MsgBox "配件名称已经存在,请重新确定其名称!"
      Rs.Close
     Exit Sub
    End If
    Rs.Close
  End If
Dim a As Integer
 a = MsgBox("********你确定此修改操作吗?**********" & vbCrLf _
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
  Make_Save
        
  MsgBox "修改配件成功!"
FrmPJGL.Show
Unload Me
End If
If a = 2 Then Exit Sub
End Sub

Private Sub Command2_Click()
   FrmPJGL.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_Int
Set_Init
End Sub
Private Sub Set_Int()
Dim i As Integer
 On Error GoTo DataErr
    sSql = "SELECT * FROM 配件库存表 where ID =" & RemId
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
  TxtName.Text = Rs!配件名称
  PJName = Rs!配件名称
  TxtModel.Text = Rs!规格型号
   TxtPJLX.Text = Rs!分类
  TxtDW.Text = Rs!单位
  TxtDJ.Text = Rs!单价
  TxtNums.Text = Rs!数量
  If Rs.Fields("备注") = "-" Then TxtBZ.Text = "" Else TxtBZ.Text = Rs.Fields("备注")

Rs.Close

  Exit Sub
DataErr:
     MsgBox Err.Description
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

⌨️ 快捷键说明

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